Created
October 22, 2012 16:10
-
-
Save skovalyov/3932280 to your computer and use it in GitHub Desktop.
Nginx configuration to deploy Node application in subdomain
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
upstream pet_project { | |
server localhost:3000; | |
} | |
server { | |
listen 80; | |
server_name pet-project.myhost; | |
location / { | |
alias /opt/demo/pet-project/public/; | |
try_files $uri @pet-project; | |
} | |
location @pet-project { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $proxy_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_pass http://pet_project; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment