Skip to content

Instantly share code, notes, and snippets.

@rd13
Last active December 11, 2015 07:18
Show Gist options
  • Save rd13/4564928 to your computer and use it in GitHub Desktop.
Save rd13/4564928 to your computer and use it in GitHub Desktop.
Nginx proxy pass to port 80 for Node / Rails app etc..
server {
listen 80;
server_name localhost.my_node_app
alias 10.72.12.91; #Rewrite all incoming requests to this app - for debugging on mobile devices etc where we cannot add to the hosts file.
access_log /var/log/nginx/my_node_app.log;
location / {
#Set correct headers
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;
#Node / Rails app server
proxy_pass http://127.0.0.1:5000;
}
}
#cd /etc/nginx/sites-available/
#vim my_node_app
#ln -s /etc/nginx/sites-available/my_node_app /etc/nginx/sites-enabled/my_node_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment