Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Created March 17, 2016 17:05
Show Gist options
  • Select an option

  • Save mrrooijen/c8865a021c0ce39fb70b to your computer and use it in GitHub Desktop.

Select an option

Save mrrooijen/c8865a021c0ce39fb70b to your computer and use it in GitHub Desktop.
Example configuration for rancher nginx proxy with ssl termination.
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
server {
listen 443 ssl;
server_name rancher.example.com;
ssl_certificate /etc/nginx/ssl/example.pem;
ssl_certificate_key /etc/nginx/ssl/example.key;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://0.0.0.0:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 900s;
}
}
server {
listen 80;
server_name rancher.example.com;
return 301 https://$server_name$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment