Skip to content

Instantly share code, notes, and snippets.

@antoinejaussoin
Last active June 15, 2018 11:29
Show Gist options
  • Save antoinejaussoin/e5bc3ac53672becbbd6fd76d108f50e3 to your computer and use it in GitHub Desktop.
Save antoinejaussoin/e5bc3ac53672becbbd6fd76d108f50e3 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name plannipoker.com;
return 301 http://www.plannipoker.com$request_uri;
}
server {
listen 80;
server_name www.plannipoker.com;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location / {
autoindex on;
try_files $uri /index.html;
alias /var/www/plannipoker/build/;
expires 1y;
}
location /api/ {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /socket.io/ {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment