Last active
January 6, 2016 16:31
-
-
Save qoomon/29f4ac9b0a2c765c07e7 to your computer and use it in GitHub Desktop.
nginx subdomain to port config HTTPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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