Skip to content

Instantly share code, notes, and snippets.

@skovalyov
Created October 22, 2012 16:10
Show Gist options
  • Save skovalyov/3932280 to your computer and use it in GitHub Desktop.
Save skovalyov/3932280 to your computer and use it in GitHub Desktop.
Nginx configuration to deploy Node application in subdomain
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