Skip to content

Instantly share code, notes, and snippets.

@DoctorOgg
Created June 13, 2018 17:17
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 DoctorOgg/73961556d8f5687e061ce9629d7a47cc to your computer and use it in GitHub Desktop.
Save DoctorOgg/73961556d8f5687e061ce9629d7a47cc to your computer and use it in GitHub Desktop.
proxy_cache_path /var/cache/nginx/site-cache levels=1:2 keys_zone=site-cache:500m max_size=4g inactive=30d;
server {
server_name site.example.com;
listen 10.49.0.74:443 http2 ssl;
listen 10.49.0.74:80;
include gzip.conf;
include brotli.conf;
include pagespeed.conf;
include /etc/nginx/ssl_parms_no_staple.conf;
pagespeed Domain http://site.example.com;
pagespeed Domain https://site.example.com;
ssl_certificate /etc/nginx/ssl/site.example.com.full.pem;
ssl_certificate_key /etc/nginx/ssl/site.example.com.key;
access_log /var/log/nginx/site.log combined;
error_log /var/log/nginx/site_error.log debug;
location ~* /(.+)$ {
proxy_pass http://site-files-on-s3.s3-website-us-west-2.amazonaws.com/$1;
proxy_cache site-cache;
proxy_cache_valid 200 302 30m;
proxy_cache_valid 404 30s;
expires 30m;
add_header Cache-Control "public";
resolver 8.8.4.4 8.8.8.8;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment