Skip to content

Instantly share code, notes, and snippets.

@mgmgpyaesonewin
Created June 8, 2022 03:35
Show Gist options
  • Save mgmgpyaesonewin/310b61184dfaf384a80f85b498fba15d to your computer and use it in GitHub Desktop.
Save mgmgpyaesonewin/310b61184dfaf384a80f85b498fba15d to your computer and use it in GitHub Desktop.
Configuring Nginx to Proxy Requests your rest api
// Replace the port number with the port you used.The server_name should also be replaced with you domain name.
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com www.example.com ;
location / {
proxy_pass http://localhost:8080;
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