Skip to content

Instantly share code, notes, and snippets.

@romedawg
Created September 9, 2016 14:24
Show Gist options
  • Save romedawg/7dcd46f8c848529744a765f369e4eb6b to your computer and use it in GitHub Desktop.
Save romedawg/7dcd46f8c848529744a765f369e4eb6b to your computer and use it in GitHub Desktop.
Nginx to server jar file(remote server)
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_pass http://simpleserver_backend;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment