Skip to content

Instantly share code, notes, and snippets.

@jackc
Created August 8, 2014 21:54
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 jackc/e70f17f6272917fdabc7 to your computer and use it in GitHub Desktop.
Save jackc/e70f17f6272917fdabc7 to your computer and use it in GitHub Desktop.
nginx config for The Pithy Reader
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