Skip to content

Instantly share code, notes, and snippets.

@leogsilva
Created August 5, 2020 21:29
Show Gist options
  • Select an option

  • Save leogsilva/243448f224c514f58bb3d68ef5d2d676 to your computer and use it in GitHub Desktop.

Select an option

Save leogsilva/243448f224c514f58bb3d68ef5d2d676 to your computer and use it in GitHub Desktop.
nginx configuration template file for simple reverse proxy server
upstream demo2.localhost {
server ${UPSTREAM};
}
server {
#ssl_certificate /etc/nginx/certs/demo.pem;
#ssl_certificate_key /etc/nginx/certs/demo.key;
gzip_types text/plain text/css application/json application/x-javascript
text/xml application/xml application/xml+rss text/javascript;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_pass http://demo2.localhost;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment