Skip to content

Instantly share code, notes, and snippets.

@andreibondarev
Created July 1, 2014 19:12
Show Gist options
  • Save andreibondarev/bc0a4d14694752b678da to your computer and use it in GitHub Desktop.
Save andreibondarev/bc0a4d14694752b678da to your computer and use it in GitHub Desktop.
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
server {
listen 8089; ## listen for ipv4; this line is default and implied
root /Users/Savinon/dev/WeddingWire/deploy;
index index.html index.htm;
server_name localhost;
autoindex off;
gzip_static on;
gzip on;
gzip_vary on;
gzip_comp_level 9;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_http_version 1.0;
# 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;
# Disable gzip for certain browsers.
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_min_length 1000;
gzip_proxied any;
if_modified_since off;
location /robots.txt {
proxy_pass http://staging.weddingwire.com:80/robots.txt;
proxy_redirect default;
}
rewrite ^/static(.*)$ $1 last;
expires +1h;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
location ~ ^/(vendor|wedding|admin|js/lib|(\d+[\d.]*/)) {
rewrite ^/\d+[\d.]*/(.*)$ /$1 break;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
location ~ .*\.ics$ {
expires +1m;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment