Created
August 8, 2014 21:54
-
-
Save jackc/e70f17f6272917fdabc7 to your computer and use it in GitHub Desktop.
nginx config for The Pithy Reader
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
server { | |
listen 80; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443; | |
server_name tpr.example.com; | |
root /usr/share/tpr/assets; | |
index index.html index.htm; | |
ssl on; | |
ssl_certificate /etc/ssl/certs/tpr.example.com.crt; | |
ssl_certificate_key /etc/ssl/private/tpr.example.com.key; | |
ssl_session_timeout 5m; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers "HIGH:!aNULL:!MD5"; | |
ssl_prefer_server_ciphers on; | |
location @go { | |
proxy_pass http://127.0.0.1:4000; | |
gzip on; | |
gzip_types *; | |
gzip_proxied any; | |
gzip_vary on; | |
} | |
location / { | |
try_files $uri $uri/ @go; | |
charset UTF-8; | |
gzip on; | |
gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml; | |
gzip_static on; | |
gzip_vary on; | |
location ~* \.(html)$ { | |
add_header Cache-Control "max-age=0, must-revalidate"; | |
} | |
location ~* \.(css|js)$ { | |
add_header Cache-Control "max-age=2592000, public"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment