Cleanup mess made doing pointless merge

This commit is contained in:
Chris McKee 2012-07-25 22:34:16 +01:00
parent c6e6fe065e
commit 22203a5d6c
6 changed files with 203 additions and 153 deletions

View File

@ -1,24 +1,19 @@
# this file is used by the nginx.conf
types { types {
text/html html htm shtml; text/html html htm shtml;
text/css css; text/css css;
# application/rss+xml causes some browsers to start a download
text/xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/json json;
# http://www.rfc-editor.org/rfc/rfc4329.txt
application/javascript js;
application/atom+xml atom;
text/cache-manifest manifest appcache; text/cache-manifest manifest appcache;
text/mathml mml; text/mathml mml;
text/plain txt; text/plain txt;
text/vnd.sun.j2me.app-descriptor jad; text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml; text/vnd.wap.wml wml;
text/x-component htc; text/x-component htc;
text/x-vcard vcf;
# JavaScript
application/javascript js jsonp;
application/json json;
# Images
image/png png; image/png png;
image/svg+xml svg svgz; image/svg+xml svg svgz;
image/tiff tif tiff; image/tiff tif tiff;
@ -27,8 +22,10 @@ types {
image/x-icon ico; image/x-icon ico;
image/x-jng jng; image/x-jng jng;
image/bmp bmp; image/bmp bmp;
image/gif gif;
image/jpeg jpeg jpg;
application/xml xml; application/xml rss atom xml rdf;
application/java-archive jar war ear; application/java-archive jar war ear;
application/mac-binhex40 hqx; application/mac-binhex40 hqx;
application/msword doc; application/msword doc;
@ -36,7 +33,6 @@ types {
application/postscript ps eps ai; application/postscript ps eps ai;
application/rtf rtf; application/rtf rtf;
application/vnd.ms-excel xls; application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt; application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc; application/vnd.wap.wmlc wmlc;
application/xhtml+xml xhtml; application/xhtml+xml xhtml;
@ -44,8 +40,9 @@ types {
application/vnd.google-earth.kmz kmz; application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z; application/x-7z-compressed 7z;
application/x-chrome-extension crx; application/x-chrome-extension crx;
application/x-opera-extension oex;
application/x-xpinstall xpi;
application/x-cocoa cco; application/x-cocoa cco;
application/x-font-ttf ttf ttc;
application/x-java-archive-diff jardiff; application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp; application/x-java-jnlp-file jnlp;
application/x-makeself run; application/x-makeself run;
@ -57,9 +54,7 @@ types {
application/x-shockwave-flash swf; application/x-shockwave-flash swf;
application/x-stuffit sit; application/x-stuffit sit;
application/x-tcl tcl tk; application/x-tcl tcl tk;
application/x-web-app-manifest+json webapp;
application/x-x509-ca-cert der pem crt; application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/zip zip; application/zip zip;
application/octet-stream bin exe dll; application/octet-stream bin exe dll;
@ -69,15 +64,17 @@ types {
application/octet-stream msi msp msm; application/octet-stream msi msp msm;
application/octet-stream safariextz; application/octet-stream safariextz;
# Audio
audio/midi mid midi kar; audio/midi mid midi kar;
audio/mpeg mp3; audio/mpeg mp3;
audio/ogg oga ogg; audio/ogg oga ogg;
audio/x-m4a m4a; audio/mp4 m4a f4a f4b aac;
audio/x-realaudio ra; audio/x-realaudio ra;
audio/x-wav wav; audio/x-wav wav;
# Video
video/3gpp 3gpp 3gp; video/3gpp 3gpp 3gp;
video/mp4 m4v mp4; video/mp4 mp4 m4v f4v f4p;
video/mpeg mpeg mpg; video/mpeg mpeg mpg;
video/ogg ogv; video/ogg ogv;
video/quicktime mov; video/quicktime mov;
@ -88,6 +85,9 @@ types {
video/x-ms-wmv wmv; video/x-ms-wmv wmv;
video/x-msvideo avi; video/x-msvideo avi;
font/opentype otf; # Webfonts
font/woff woff; application/vnd.ms-fontobject eot;
application/x-font-ttf ttf ttc;
application/x-font-opentype otf;
application/x-font-woff woff;
} }

View File

@ -60,19 +60,17 @@ http {
gzip_types gzip_types
# text/html is always compressed by HttpGzipModule # text/html is always compressed by HttpGzipModule
text/css text/css
text/javascript
text/xml
text/plain text/plain
text/x-component text/x-component
application/javascript application/javascript
application/x-javascript
application/json application/json
application/xml application/xml
application/rss+xml application/xhtml+xml
font/truetype application/x-font-ttf
font/opentype application/x-font-opentype
application/vnd.ms-fontobject application/vnd.ms-fontobject
image/svg+xml; image/svg+xml
image/x-icon;
# This should be turned on if you are going to have pre-compressed copies (.gz) of # This should be turned on if you are going to have pre-compressed copies (.gz) of
# static files available. If not it should be left off as it will cause extra I/O # static files available. If not it should be left off as it will cause extra I/O
@ -83,67 +81,6 @@ http {
gzip_disable "MSIE [1-6]\."; gzip_disable "MSIE [1-6]\.";
gzip_vary on; gzip_vary on;
server { include sites-enabled/*.conf;
# listen 80 default_server deferred; # for Linux
# listen 80 default_server accept_filter=httpready; # for FreeBSD
listen 80 default_server;
# e.g. "localhost" to accept all connections, or "www.example.com"
# to handle the requests for "example.com" (and www.example.com)
# server_name www.example.com;
# Path for static files
root /sites/example.com/public;
#Specify a charset
charset utf-8;
# Custom 404 page
error_page 404 /404.html;
# No default expire rule. This config mirrors that of apache as outlined in the
# html5-boilerplate .htaccess file. However, nginx applies rules by location, the apache rules
# are defined by type. A concequence of this difference is that if you use no file extension in
# the url and serve html, with apache you get an expire time of 0s, with nginx you'd get an
# expire header of one month in the future (if the default expire rule is 1 month).
# Therefore, do not use a default expire rule with nginx unless your site is completely static
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html|xml|json)$ {
expires -1;
access_log logs/static.log;
}
# Feed
location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control "public";
}
# Favicon
location ~* \.ico$ {
expires 1w;
access_log off;
add_header Cache-Control "public";
}
# Media: images, video, audio, HTC, WebFonts
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# opt-in to the future
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
} }
}

View File

@ -0,0 +1,4 @@
Sites Available
---------------
Define host definitions here

View File

@ -0,0 +1,92 @@
server {
# listen 80 default_server deferred; # for Linux
# listen 80 default_server accept_filter=httpready; # for FreeBSD
listen 80 default_server;
# listen on the non-www host -- the www-host is declared in www-redirect.conf
# here
server_name example.com;
# Path for static files
root /sites/example.com/public;
#Specify a charset
charset utf-8;
# Custom 404 page
error_page 404 /404.html;
# Built-in filename-based cache busting
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L403
# This will route all requests for /css/style.20120716.css to /css/style.css
# Read also this: github.com/h5bp/html5-boilerplate/wiki/cachebusting
# This is disabled by default, because it'd be better if you use the build
# script to manage the file names.
# location ~* (.+)\.(\d+)\.(js|css|png|jpg|jpeg|gif)$ {
# try_files $uri $1.$3;
# }
# No default expire rule. This config mirrors that of apache as outlined in the
# html5-boilerplate .htaccess file. However, nginx applies rules by location, the apache rules
# are defined by type. A concequence of this difference is that if you use no file extension in
# the url and serve html, with apache you get an expire time of 0s, with nginx you'd get an
# expire header of one month in the future (if the default expire rule is 1 month).
# Therefore, do not use a default expire rule with nginx unless your site is completely static
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html|xml|json)$ {
expires -1;
access_log logs/static.log;
}
# Feed
location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control "public";
}
# Favicon
location ~* \.ico$ {
expires 1w;
access_log off;
add_header Cache-Control "public";
}
# Media: images, video, audio, HTC, WebFonts
location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
# opt-in to the future
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
# Cross domain AJAX requests
# add_header "Access-Control-Allow-Origin" "*";
# Cross domain webfont access
location ~* \.(ttf|ttc|otf|eot|woff|font.css)$ {
add_header "Access-Control-Allow-Origin" "*";
}
# Prevent mobile network providers from modifying your site
# add_header "Cache-Control" "no-transform";
# Prevent clients from accessing hidden files (starting with a dot)
location ~* (^|/)\. {
return 403;
}
# Prevent clients from accessing to backup/config/source files
location ~* (\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$ {
return 403;
}
}

View File

@ -0,0 +1,12 @@
# www to non-www redirect -- duplicate content is BAD:
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L362
# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
server {
# don't forget to tell on which port this server listens
listen 80;
# listen on the www host
server_name www.example.com
# and redirect to the non-www host (declared below)
return 301 $scheme://example.com$request_uri;
}

View File

@ -0,0 +1,5 @@
Sites Enabled
-------------
Symlink to `../sites-available/` for any site you want to enable. Conversely, remove the symlink
in this folder to disable a site without permanently deleting the site's configuration.