Skip to content

Instantly share code, notes, and snippets.

@cbliard
Last active August 29, 2015 14:10
Show Gist options
  • Save cbliard/b8f9b994b502b73d0035 to your computer and use it in GitHub Desktop.
Save cbliard/b8f9b994b502b73d0035 to your computer and use it in GitHub Desktop.
Nginx reverse proxy
proxy_set_header Host $http_host;
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;
server {
listen 80 default_server;
server_name svn.example.com;
location / {
include proxy_params;
# internal address for svn
proxy_pass http://localhost:8000;
proxy_redirect http://$host:8000 http://$host;
}
}
server {
listen 80;
server_name jenkins.example.com;
location / {
include proxy_params;
# internal address for jenkins
proxy_pass http://localhost:8080;
proxy_redirect http://$host:8080 http://$host;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment