Skip to content

Instantly share code, notes, and snippets.

@qoomon
Last active January 6, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qoomon/29f4ac9b0a2c765c07e7 to your computer and use it in GitHub Desktop.
Save qoomon/29f4ac9b0a2c765c07e7 to your computer and use it in GitHub Desktop.
nginx subdomain to port config HTTPS
# replace <ServiceSubDomain>
# replace <LocalPort>
# replace <SslFileName>
server {
listen 443 ssl;
server_name <ServiceSubDomain>.*;
access_log off;
ssl_certificate /etc/ssl/certs/<SslFileName>.pem;
ssl_certificate_key /etc/ssl/private/<SslFileName>.key;
# Increase this to JIRA's maximum attachment size (10M by default)
client_max_body_size 10M;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:<LocalPort>;
proxy_buffering off;
}
}
## Redirect to HTTPS
server {
server_name <ServiceSubDomain>.*;
listen 80;
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