Created
May 1, 2014 12:08
-
-
Save willscripted/11450312 to your computer and use it in GitHub Desktop.
Nginx config to do ssl termination and serve static assets. If static assets are not found, forward request to another server
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 api { | |
| server hopper-api.herokuapp.com; | |
| } | |
| server { | |
| listen 80; | |
| listen 443 ssl; | |
| server_name www.schedjs.com$; | |
| ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
| ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5; | |
| ssl_certificate certs/schedjs/server.crt; | |
| ssl_certificate_key certs/schedjs/server.key; | |
| ssl_session_cache shared:SSL:10m; | |
| ssl_session_timeout 10m; | |
| location / { | |
| root /var/www; | |
| try_files $uri $uri/index.html @api; | |
| expires max; | |
| access_log off; | |
| } | |
| location @api { | |
| proxy_pass http://api; | |
| proxy_redirect off; | |
| proxy_buffering off; | |
| proxy_set_header Host hopper-api.herokuapp.com; | |
| 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; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment