Skip to content

Instantly share code, notes, and snippets.

@DRBragg
Created February 15, 2019 16:38
Show Gist options
  • Save DRBragg/f78467d1df34d32795152997c055c8f9 to your computer and use it in GitHub Desktop.
Save DRBragg/f78467d1df34d32795152997c055c8f9 to your computer and use it in GitHub Desktop.
nginx config stuffs
# /etc/nginx/nginx.conf
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_min_length 10240;
# /etc/nginx/sites-enabled/SITE_NAME
server {
server_name SERVER_NAME.com;
passenger_enabled on;
rails_env production;
root /home/deploy/APP_NAME/current/public;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
###
# asset caching policy
###
location ~ ^/assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header ETag "";
add_header Last-Modified "";
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl http2; # managed by Certbot <-- Add http2 to this line after configuring https w/ Certbot
###
# Certbot config
###
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment