Created
February 1, 2015 08:16
-
-
Save arikfr/95f0706a3457fad7489a to your computer and use it in GitHub Desktop.
re:dash nginx site config with sll
This file contains hidden or 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
| upstream redash_servers { | |
| server 127.0.0.1:5000; | |
| } | |
| server { | |
| listen [::]:80; | |
| listen 443 default_server ssl; | |
| # Make sure to set paths to your certificate .pem and .key files. | |
| ssl_certificate /path-to/cert.pem; | |
| ssl_certificate_key /path-to/cert.key; | |
| access_log /var/log/nginx/redash.access.log; | |
| gzip on; | |
| gzip_types *; | |
| gzip_proxied any; | |
| # Allow accessing /ping without https. Useful when placing behind load balancer. | |
| location /ping { | |
| 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_pass http://redash_servers; | |
| } | |
| location / { | |
| # Enforce SSL. | |
| if ($ssl_protocol = "") { | |
| rewrite ^ https://$server_name$request_uri? permanent; | |
| } | |
| 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_pass http://redash_servers; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment