Last active
December 11, 2015 07:18
-
-
Save rd13/4564928 to your computer and use it in GitHub Desktop.
Nginx proxy pass to port 80 for Node / Rails app etc..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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