Skip to content

Instantly share code, notes, and snippets.

@robertz
Last active April 10, 2018 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertz/8642b6893424d31bca528a6d2d2372ce to your computer and use it in GitHub Desktop.
Save robertz/8642b6893424d31bca528a6d2d2372ce to your computer and use it in GitHub Desktop.
Development nginx configuration
upstream backend {
server dev-node:3000;
}
upstream webpack {
server dev-webpack:8080;
}
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 / {
proxy_pass http://webpack;
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 ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment