Skip to content

Instantly share code, notes, and snippets.

@mgmgpyaesonewin
Created August 4, 2022 07:16
Show Gist options
  • Save mgmgpyaesonewin/a80051b7cd59e4c2de777e17f3814bd5 to your computer and use it in GitHub Desktop.
Save mgmgpyaesonewin/a80051b7cd59e4c2de777e17f3814bd5 to your computer and use it in GitHub Desktop.
reverse proxy for multiple server nginx
upstream preprod-apim-am.wavemoney.io {
server localhost:3000;
}
upstream preprod-apim-gw.wavemoney.io {
server localhost:4000;
}
server {
listen 80;
server_name preprod-apim-am.wavemoney.io;
location / {
proxy_pass http://preprod-apim-am.wavemoney.io;
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;
}
}
server {
listen 80;
server_name preprod-apim-gw.wavemoney.io;
location / {
proxy_pass http://preprod-apim-gw.wavemoney.io;
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment