Skip to content

Instantly share code, notes, and snippets.

@robertz
Last active April 10, 2018 23:33
Show Gist options
  • Save robertz/421e92e254cfe438f599dca9a01ca7cf to your computer and use it in GitHub Desktop.
Save robertz/421e92e254cfe438f599dca9a01ca7cf to your computer and use it in GitHub Desktop.
Production nginx config
upstream backend {
server fullstack-node:3000;
}
server {
listen 80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
location /api {
proxy_pass http://backend;
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;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment