Skip to content

Instantly share code, notes, and snippets.

@lulalachen
Created June 22, 2017 03:50
Show Gist options
  • Save lulalachen/08640400fcf380b809307c656a7ee397 to your computer and use it in GitHub Desktop.
Save lulalachen/08640400fcf380b809307c656a7ee397 to your computer and use it in GitHub Desktop.
nginx setting
root@TimeXchange-stagging:/etc/nginx# cat sites-enabled/happybirthday.hangee.me
server {
listen 80;
server_name happybirthday.hangee.me;
root /www/hangee/docs;
location ~ (?:.+\/)((?:.+)\.(?:.+)) {
# $1 is the filename
try_files $uri /$1 /css/$1 =404;
}
location / {
try_files $uri /index.html;
}
}
root@TimeXchange-stagging:/etc/nginx# cat sites-enabled/kanban.timexchange.cc
server {
listen 80;
server_name kanban.timexchange.cc;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the "It appears that your reverse proxy set up is broken" error.
proxy_pass https://127.0.0.1:3030;
proxy_read_timeout 90;
}
location /ws {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Orgin "";
proxy_pass https://127.0.0.1:3030;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment