Skip to content

Instantly share code, notes, and snippets.

@iGEL
Created March 1, 2012 08:10
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 iGEL/1948225 to your computer and use it in GitHub Desktop.
Save iGEL/1948225 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name stage.example.com;
access_log /var/log/nginx/stage.example.com.access.log;
error_log /var/log/nginx/stage.example.com.error.log warn;
root /home/igel/www/stage.example.com/current/public;
passenger_enabled on;
rails_env stage;
error_page 503 /system/maintenance.html;
if (-f $document_root/system/maintenance.html) {
return 503;
}
# Gzip
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 9;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript text/x-component application/javascript font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
gzip_buffers 16 8k;
# auth_basic "Restricted";
#auth_basic_user_file /var/www/stage.passwd;
location ~* ^/images$ {
expires 1d;
break;
}
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
#auth_basic off;
expires max;
}
location ~* \.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|otf|mp4|ogg|ogv|webm)$ {
#auth_basic off;
expires max;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment