Skip to content

Instantly share code, notes, and snippets.

@TheSirop
Created October 19, 2017 10:32
Show Gist options
  • Select an option

  • Save TheSirop/b59f050eccd0422928a3d68f91224985 to your computer and use it in GitHub Desktop.

Select an option

Save TheSirop/b59f050eccd0422928a3d68f91224985 to your computer and use it in GitHub Desktop.
Nginx server configuration for subdomains
upstream project {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name mysite.com;
location / {
proxy_pass http://project;
proxy_http_version 1.1;
proxy_set_header Host mysite.com;
}
}
server {
listen 80;
server_name subdomain.mysite.com;
location / {
proxy_pass http://project;
proxy_http_version 1.1;
proxy_set_header Host subdomain.mysite.com;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment