Showing posts with label nginx. Show all posts
Showing posts with label nginx. Show all posts

Monday, June 23, 2014

Node.js + nginx: not so simple, but very awesome

Al last!! I've configured node.js + nginx, it was a bit hard to understand the concept of upstream, but now I get it, and it's awesome!!!


First, I've configured the upstream for the reverse proxy

upstream myapi {
                server 127.0.0.1:8080;
        }

Next, I've setup the server

location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_pass http://myapi;
        proxy_redirect off;
  }

With that, I can bypass node request using nginx!!!

Sunday, June 22, 2014

Starting with ideas and practice... but more practice

I'm experimenting with node.js, mongodb, nginx and Android. I want to create a little app to learn how to integrate those technologies. The idea is to create and Android app that receives data from a REST API developer with restify using mongodb as a storage, and a little website to write data in it.

Today, I've created the REST API, next I will try to test the integration between Android and the REST API, next.... I don't know!!! It doesn't matter. It only matters to me that I'm working and learning a lot with that, and time will tell if the learned will become more important. I don't want to worry about that.

So. Let's type!!!