html5-boilerplate 0.2.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -18
- data/VERSION +1 -1
- data/stylesheets/html5-boilerplate/_fonts.scss +1 -7
- data/stylesheets/html5-boilerplate/_helpers.scss +2 -4
- data/stylesheets/html5-boilerplate/_media.scss +8 -7
- data/stylesheets/html5-boilerplate/_reset.scss +7 -17
- data/stylesheets/html5-boilerplate/_styles.scss +9 -12
- data/templates/project/_head.html.haml +3 -8
- data/templates/project/_javascripts.html.haml +8 -11
- data/templates/project/application.html.haml +3 -3
- data/templates/project/files/htaccess +194 -19
- data/templates/project/files/humans.txt +43 -0
- data/templates/project/index.html.haml +4 -13
- data/templates/project/javascripts/plugins.js +3 -32
- data/templates/project/javascripts/rails.js +137 -156
- data/templates/project/javascripts/script.js +26 -0
- data/templates/project/manifest.rb +8 -15
- data/templates/project/partials/_base.scss +1 -1
- data/templates/project/partials/_example.scss +0 -21
- data/templates/project/partials/_fonts.scss +4 -0
- data/templates/project/partials/_media.scss +21 -0
- data/templates/project/style.scss +14 -9
- metadata +8 -12
- data/templates/project/files/lighttpd.conf +0 -149
- data/templates/project/files/mime.types +0 -80
- data/templates/project/files/nginx.conf +0 -108
- data/templates/project/files/web.config +0 -207
- data/templates/project/javascripts/profiling/charts.swf +0 -0
- data/templates/project/javascripts/profiling/config.js +0 -59
- data/templates/project/javascripts/profiling/yahoo-profiling.css +0 -7
- data/templates/project/javascripts/profiling/yahoo-profiling.min.js +0 -39
@@ -4,6 +4,8 @@ stylesheet 'style.scss', :media => 'all'
|
|
4
4
|
stylesheet 'handheld.scss', :media => 'handheld'
|
5
5
|
stylesheet 'partials/_base.scss'
|
6
6
|
stylesheet 'partials/_example.scss'
|
7
|
+
stylesheet 'partials/_fonts.scss'
|
8
|
+
stylesheet 'partials/_media.scss'
|
7
9
|
stylesheet 'partials/_page.scss'
|
8
10
|
|
9
11
|
if Compass.configuration.project_type == :rails
|
@@ -15,33 +17,24 @@ if Compass.configuration.project_type == :rails
|
|
15
17
|
file '_javascripts.html.haml', :to => 'app/views/layouts/_javascripts.html.haml'
|
16
18
|
file '_stylesheets.html.haml', :to => 'app/views/layouts/_stylesheets.html.haml'
|
17
19
|
file 'files/google.yml', :to => 'config/google.yml'
|
18
|
-
file 'files/nginx.conf', :to => 'config/nginx.conf'
|
19
20
|
javascript 'javascripts/dd_belatedpng.js', :to => 'dd_belatedpng.js'
|
20
|
-
javascript 'javascripts/jquery-1.4.4.min.js', :to => 'jquery
|
21
|
-
javascript 'javascripts/modernizr-1.6.min.js', :to => 'modernizr
|
21
|
+
javascript 'javascripts/jquery-1.4.4.min.js', :to => 'jquery.min.js'
|
22
|
+
javascript 'javascripts/modernizr-1.6.min.js', :to => 'modernizr.min.js'
|
22
23
|
javascript 'javascripts/plugins.js', :to => 'plugins.js'
|
23
24
|
javascript 'javascripts/rails.js', :to => 'rails.js'
|
24
|
-
javascript 'javascripts/profiling/charts.swf', :to => 'profiling/charts.swf'
|
25
|
-
javascript 'javascripts/profiling/config.js', :to => 'profiling/config.js'
|
26
|
-
javascript 'javascripts/profiling/yahoo-profiling.css', :to => 'profiling/yahoo-profiling.css'
|
27
|
-
javascript 'javascripts/profiling/yahoo-profiling.min.js', :to => 'profiling/yahoo-profiling.min.js'
|
28
25
|
else
|
29
26
|
html 'index.html.haml'
|
30
|
-
file 'files/nginx.conf', :to => 'nginx.conf'
|
31
|
-
file 'files/web.config', :to => 'web.config'
|
32
27
|
javascript 'javascripts/dd_belatedpng.js', :to => 'dd_belatedpng.js'
|
33
|
-
javascript 'javascripts/jquery-1.4.4.min.js', :to => 'jquery
|
34
|
-
javascript 'javascripts/modernizr-1.6.min.js', :to => 'modernizr
|
28
|
+
javascript 'javascripts/jquery-1.4.4.min.js', :to => 'jquery.min.js'
|
29
|
+
javascript 'javascripts/modernizr-1.6.min.js', :to => 'modernizr.min.js'
|
35
30
|
javascript 'javascripts/plugins.js', :to => 'plugins.js'
|
36
|
-
javascript 'javascripts/
|
37
|
-
javascript 'javascripts/profiling/config.js', :to => 'profiling/config.js'
|
38
|
-
javascript 'javascripts/profiling/yahoo-profiling.css', :to => 'profiling/yahoo-profiling.css'
|
39
|
-
javascript 'javascripts/profiling/yahoo-profiling.min.js', :to => 'profiling/yahoo-profiling.min.js'
|
31
|
+
javascript 'javascripts/script.js', :to => 'script.js'
|
40
32
|
end
|
41
33
|
html 'files/404.html', :to => '404.html'
|
42
34
|
html 'files/htaccess', :to => '.htaccess'
|
43
35
|
html 'files/crossdomain.xml', :to => 'crossdomain.xml'
|
44
36
|
html 'files/robots.txt', :to => 'robots.txt'
|
37
|
+
html 'files/humans.txt', :to => 'humans.txt'
|
45
38
|
html 'files/apple-touch-icon.png', :to => 'apple-touch-icon.png'
|
46
39
|
html 'files/favicon.ico', :to => 'favicon.ico'
|
47
40
|
|
@@ -58,24 +58,3 @@ sup { @include sup; }
|
|
58
58
|
.clearfix {
|
59
59
|
@include pie-clearfix; // defined by compass core
|
60
60
|
}
|
61
|
-
|
62
|
-
|
63
|
-
//--------------------------------
|
64
|
-
// Media
|
65
|
-
//--------------------------------
|
66
|
-
@media print {
|
67
|
-
@include media-print;
|
68
|
-
}
|
69
|
-
|
70
|
-
@media all and (orientation:portrait) {
|
71
|
-
// Style adjustments for portrait mode goes here
|
72
|
-
}
|
73
|
-
|
74
|
-
@media all and (orientation:landscape) {
|
75
|
-
// Style adjustments for landscape mode goes here
|
76
|
-
}
|
77
|
-
|
78
|
-
@media screen and (max-device-width: 480px) {
|
79
|
-
// Pass in false if you don't want iOS and WinMobile to mobile-optimize the text for you
|
80
|
-
@include media-mobile(true);
|
81
|
-
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
//
|
2
|
+
// These are in their own partial because you probably
|
3
|
+
// want to customize on a per-site basis
|
4
|
+
//
|
5
|
+
|
6
|
+
@media print {
|
7
|
+
@include media-print;
|
8
|
+
}
|
9
|
+
|
10
|
+
@media all and (orientation:portrait) {
|
11
|
+
// Style adjustments for portrait mode goes here
|
12
|
+
}
|
13
|
+
|
14
|
+
@media all and (orientation:landscape) {
|
15
|
+
// Style adjustments for landscape mode goes here
|
16
|
+
}
|
17
|
+
|
18
|
+
@media screen and (max-device-width: 480px) {
|
19
|
+
// Pass in false if you don't want iOS and WinMobile to mobile-optimize the text for you
|
20
|
+
@include media-mobile(true);
|
21
|
+
}
|
@@ -4,21 +4,26 @@
|
|
4
4
|
// Then we'll import the compass extension
|
5
5
|
@import "html5-boilerplate";
|
6
6
|
|
7
|
-
//
|
7
|
+
// If you don't require any customization
|
8
|
+
// you can choose to include the whole
|
8
9
|
// enchilada by uncommeting this line
|
9
10
|
//@include html5-boilerplate;
|
10
11
|
|
11
12
|
// Or, you can pick and choose only the
|
12
13
|
// sections you want to include
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
//@include html5-boilerplate-media;
|
14
|
+
@include html5-boilerplate-reset;
|
15
|
+
@include html5-boilerplate-fonts;
|
16
|
+
@include html5-boilerplate-styles;
|
17
|
+
@include html5-boilerplate-helpers;
|
18
18
|
|
19
19
|
// Or else, you can import this partial if you
|
20
|
-
// want more
|
21
|
-
|
20
|
+
// want more control over which mixins to use
|
21
|
+
//@import "partials/example";
|
22
22
|
|
23
|
-
// Finally, put your own styles in
|
23
|
+
// Finally, put your own styles in these partials
|
24
|
+
// and add more as needed (i.e. forms, tables, nav)
|
25
|
+
@import "partials/fonts";
|
24
26
|
@import "partials/page";
|
27
|
+
|
28
|
+
// Media should come last
|
29
|
+
@import "partials/media";
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Peter Gumeson
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-25 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -66,25 +66,21 @@ files:
|
|
66
66
|
- templates/project/files/crossdomain.xml
|
67
67
|
- templates/project/files/favicon.ico
|
68
68
|
- templates/project/files/google.yml
|
69
|
-
- templates/project/files/
|
70
|
-
- templates/project/files/mime.types
|
71
|
-
- templates/project/files/nginx.conf
|
69
|
+
- templates/project/files/humans.txt
|
72
70
|
- templates/project/files/robots.txt
|
73
|
-
- templates/project/files/web.config
|
74
71
|
- templates/project/handheld.scss
|
75
72
|
- templates/project/index.html.haml
|
76
73
|
- templates/project/javascripts/dd_belatedpng.js
|
77
74
|
- templates/project/javascripts/jquery-1.4.4.min.js
|
78
75
|
- templates/project/javascripts/modernizr-1.6.min.js
|
79
76
|
- templates/project/javascripts/plugins.js
|
80
|
-
- templates/project/javascripts/profiling/charts.swf
|
81
|
-
- templates/project/javascripts/profiling/config.js
|
82
|
-
- templates/project/javascripts/profiling/yahoo-profiling.css
|
83
|
-
- templates/project/javascripts/profiling/yahoo-profiling.min.js
|
84
77
|
- templates/project/javascripts/rails.js
|
78
|
+
- templates/project/javascripts/script.js
|
85
79
|
- templates/project/manifest.rb
|
86
80
|
- templates/project/partials/_base.scss
|
87
81
|
- templates/project/partials/_example.scss
|
82
|
+
- templates/project/partials/_fonts.scss
|
83
|
+
- templates/project/partials/_media.scss
|
88
84
|
- templates/project/partials/_page.scss
|
89
85
|
- templates/project/style.scss
|
90
86
|
has_rdoc: true
|
@@ -1,149 +0,0 @@
|
|
1
|
-
############ Options you really have to take care of ####################
|
2
|
-
|
3
|
-
## Run as an unpriveleged user
|
4
|
-
server.username = "www"
|
5
|
-
server.groupname = "www"
|
6
|
-
|
7
|
-
## to help the rc.scripts
|
8
|
-
server.pid-file = "/var/run/lighttpd/lighttpd.pid"
|
9
|
-
|
10
|
-
## A static document-root. For virtual hosting take a look at the
|
11
|
-
## mod_simple_vhost module.
|
12
|
-
server.document-root = "/var/www/sites/go/here/"
|
13
|
-
|
14
|
-
## modules to load
|
15
|
-
# at least mod_access and mod_accesslog should be loaded
|
16
|
-
server.modules = (
|
17
|
-
"mod_access",
|
18
|
-
"mod_accesslog",
|
19
|
-
"mod_redirect",
|
20
|
-
"mod_compress",
|
21
|
-
"mod_expire"
|
22
|
-
)
|
23
|
-
|
24
|
-
### File uploads
|
25
|
-
# Make sure this folder exists and is writable to server.username
|
26
|
-
server.upload-dirs = ( "/tmp/lighttpd/uploads" )
|
27
|
-
|
28
|
-
## where to send error-messages to
|
29
|
-
server.errorlog = "/var/log/lighttpd/error.log"
|
30
|
-
|
31
|
-
#### accesslog module
|
32
|
-
accesslog.filename = "/var/log/lighttpd/access.log"
|
33
|
-
|
34
|
-
### compress module
|
35
|
-
# Make sure this folder exists and is writable to server.username
|
36
|
-
compress.cache-dir = "/tmp/lighttpd/compress/"
|
37
|
-
compress.filetype = (
|
38
|
-
"text/plain",
|
39
|
-
"text/html",
|
40
|
-
"text/css",
|
41
|
-
"application/json",
|
42
|
-
"text/javascript",
|
43
|
-
"application/javascript",
|
44
|
-
"application/x-javascript",
|
45
|
-
"text/xml",
|
46
|
-
"application/xml",
|
47
|
-
"application/xml-rss",
|
48
|
-
"text/x-component",
|
49
|
-
)
|
50
|
-
|
51
|
-
# files to check for if .../ is requested
|
52
|
-
index-file.names = (
|
53
|
-
"index.html",
|
54
|
-
"index.htm",
|
55
|
-
)
|
56
|
-
|
57
|
-
## set the event-handler (read the performance section in the manual)
|
58
|
-
# server.event-handler = "freebsd-kqueue" # needed on OS X
|
59
|
-
|
60
|
-
# mimetype mapping
|
61
|
-
mimetype.assign = (
|
62
|
-
".pdf" => "application/pdf",
|
63
|
-
".sig" => "application/pgp-signature",
|
64
|
-
".spl" => "application/futuresplash",
|
65
|
-
".class" => "application/octet-stream",
|
66
|
-
".safariextz" => "application/octet-stream",
|
67
|
-
".ps" => "application/postscript",
|
68
|
-
".torrent" => "application/x-bittorrent",
|
69
|
-
".crx" => "application/x-chrome-extension",
|
70
|
-
".dvi" => "application/x-dvi",
|
71
|
-
".gz" => "application/x-gzip",
|
72
|
-
".pac" => "application/x-ns-proxy-autoconfig",
|
73
|
-
".swf" => "application/x-shockwave-flash",
|
74
|
-
".tar.gz" => "application/x-tgz",
|
75
|
-
".tgz" => "application/x-tgz",
|
76
|
-
".tar" => "application/x-tar",
|
77
|
-
".xpi" => "application/x-xpinstall",
|
78
|
-
".zip" => "application/zip",
|
79
|
-
".mp3" => "audio/mpeg",
|
80
|
-
".m3u" => "audio/x-mpegurl",
|
81
|
-
".wma" => "audio/x-ms-wma",
|
82
|
-
".wax" => "audio/x-ms-wax",
|
83
|
-
".ogg" => "application/ogg",
|
84
|
-
".wav" => "audio/x-wav",
|
85
|
-
".gif" => "image/gif",
|
86
|
-
".jar" => "application/x-java-archive",
|
87
|
-
".jpg" => "image/jpeg",
|
88
|
-
".jpeg" => "image/jpeg",
|
89
|
-
".png" => "image/png",
|
90
|
-
".xbm" => "image/x-xbitmap",
|
91
|
-
".xpm" => "image/x-xpixmap",
|
92
|
-
".xwd" => "image/x-xwindowdump",
|
93
|
-
".css" => "text/css",
|
94
|
-
".html" => "text/html",
|
95
|
-
".htm" => "text/html",
|
96
|
-
".js" => "text/javascript",
|
97
|
-
".json" => "text/javascript",
|
98
|
-
".asc" => "text/plain",
|
99
|
-
".c" => "text/plain",
|
100
|
-
".cpp" => "text/plain",
|
101
|
-
".log" => "text/plain",
|
102
|
-
".conf" => "text/plain",
|
103
|
-
".text" => "text/plain",
|
104
|
-
".txt" => "text/plain",
|
105
|
-
".dtd" => "text/xml",
|
106
|
-
".xml" => "text/xml",
|
107
|
-
".mpeg" => "video/mpeg",
|
108
|
-
".mpg" => "video/mpeg",
|
109
|
-
".mov" => "video/quicktime",
|
110
|
-
".qt" => "video/quicktime",
|
111
|
-
".avi" => "video/x-msvideo",
|
112
|
-
".asf" => "video/x-ms-asf",
|
113
|
-
".asx" => "video/x-ms-asf",
|
114
|
-
".wmv" => "video/x-ms-wmv",
|
115
|
-
".bz2" => "application/x-bzip",
|
116
|
-
".tbz" => "application/x-bzip-compressed-tar",
|
117
|
-
".tar.bz2" => "application/x-bzip-compressed-tar",
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
# default mime type
|
122
|
-
"" => "application/octet-stream",
|
123
|
-
)
|
124
|
-
|
125
|
-
## deny access the file-extensions
|
126
|
-
#
|
127
|
-
# ~ is for backupfiles from vi, emacs, joe, ...
|
128
|
-
# .inc is often used for code includes which should in general not be part
|
129
|
-
# of the document-root
|
130
|
-
url.access-deny = ( "~", ".inc" )
|
131
|
-
|
132
|
-
$HTTP["url"] =~ "\.pdf$" {
|
133
|
-
server.range-requests = "disable"
|
134
|
-
}
|
135
|
-
|
136
|
-
##
|
137
|
-
# which extensions should not be handle via static-file transfer
|
138
|
-
#
|
139
|
-
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
|
140
|
-
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
|
141
|
-
|
142
|
-
## bind to all ips, or change to a specific ip
|
143
|
-
server.bind = "0.0.0.0"
|
144
|
-
|
145
|
-
# If its an asset, expires in a month from now
|
146
|
-
expire.url = (
|
147
|
-
"\.(ico|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)" => "access plus 10 years",
|
148
|
-
".*" => "access plus 1 month"
|
149
|
-
)
|
@@ -1,80 +0,0 @@
|
|
1
|
-
types {
|
2
|
-
text/html html htm shtml;
|
3
|
-
text/css css;
|
4
|
-
text/xml xml rss;
|
5
|
-
image/gif gif;
|
6
|
-
image/jpeg jpeg jpg;
|
7
|
-
application/x-javascript js;
|
8
|
-
application/atom+xml atom;
|
9
|
-
|
10
|
-
text/cache-manifest manifest;
|
11
|
-
text/mathml mml;
|
12
|
-
text/plain txt;
|
13
|
-
text/vnd.sun.j2me.app-descriptor jad;
|
14
|
-
text/vnd.wap.wml wml;
|
15
|
-
text/x-component htc;
|
16
|
-
|
17
|
-
image/png png;
|
18
|
-
image/svg+xml svg svgz;
|
19
|
-
image/tiff tif tiff;
|
20
|
-
image/vnd.wap.wbmp wbmp;
|
21
|
-
image/webp webp;
|
22
|
-
image/vnd.microsoft.icon ico;
|
23
|
-
image/x-jng jng;
|
24
|
-
image/x-ms-bmp bmp;
|
25
|
-
|
26
|
-
application/java-archive jar war ear;
|
27
|
-
application/mac-binhex40 hqx;
|
28
|
-
application/msword doc;
|
29
|
-
application/pdf pdf;
|
30
|
-
application/postscript ps eps ai;
|
31
|
-
application/rtf rtf;
|
32
|
-
application/vnd.ms-excel xls;
|
33
|
-
application/vnd.ms-powerpoint ppt;
|
34
|
-
application/vnd.wap.wmlc wmlc;
|
35
|
-
application/vnd.wap.xhtml+xml xhtml;
|
36
|
-
application/x-chrome-extension crx;
|
37
|
-
application/x-cocoa cco;
|
38
|
-
application/x-java-archive-diff jardiff;
|
39
|
-
application/x-java-jnlp-file jnlp;
|
40
|
-
application/x-makeself run;
|
41
|
-
application/x-perl pl pm;
|
42
|
-
application/x-pilot prc pdb;
|
43
|
-
application/x-rar-compressed rar;
|
44
|
-
application/x-redhat-package-manager rpm;
|
45
|
-
application/x-sea sea;
|
46
|
-
application/x-shockwave-flash swf;
|
47
|
-
application/x-stuffit sit;
|
48
|
-
application/x-tcl tcl tk;
|
49
|
-
application/x-x509-ca-cert der pem crt;
|
50
|
-
application/x-xpinstall xpi;
|
51
|
-
application/zip zip;
|
52
|
-
|
53
|
-
application/octet-stream bin exe dll;
|
54
|
-
application/octet-stream deb;
|
55
|
-
application/octet-stream dmg;
|
56
|
-
application/octet-stream iso img;
|
57
|
-
application/octet-stream msi msp msm;
|
58
|
-
application/octet-stream safariextz
|
59
|
-
|
60
|
-
audio/midi mid midi kar;
|
61
|
-
audio/mpeg mp3;
|
62
|
-
audio/x-realaudio ra;
|
63
|
-
audio/ogg oga ogg;
|
64
|
-
|
65
|
-
video/3gpp 3gpp 3gp;
|
66
|
-
video/mpeg mpeg mpg;
|
67
|
-
video/ogg ogv;
|
68
|
-
video/quicktime mov;
|
69
|
-
video/webm webm;
|
70
|
-
video/x-flv flv;
|
71
|
-
video/x-mng mng;
|
72
|
-
video/x-ms-asf asx asf;
|
73
|
-
video/x-ms-wmv wmv;
|
74
|
-
video/x-msvideo avi;
|
75
|
-
|
76
|
-
application/vnd.ms-fontobject eot;
|
77
|
-
font/truetype ttf;
|
78
|
-
font/opentype otf;
|
79
|
-
font/woff woff;
|
80
|
-
}
|
@@ -1,108 +0,0 @@
|
|
1
|
-
# Set another default user than root for security reasons
|
2
|
-
user www www;
|
3
|
-
|
4
|
-
# As a thumb rule: One per CPU. If you are serving a large amount
|
5
|
-
# of static files, which requires blocking disk reads, you may want
|
6
|
-
# to increase this from the number of cpu_cores available on your
|
7
|
-
# system.
|
8
|
-
#
|
9
|
-
# The maximum number of connections for Nginx is calculated by:
|
10
|
-
# max_clients = worker_processes * worker_connections
|
11
|
-
worker_processes 1;
|
12
|
-
|
13
|
-
# Maximum file descriptors that can be opened per process
|
14
|
-
# This should be > worker_connections
|
15
|
-
worker_rlimit_nofile 8192;
|
16
|
-
|
17
|
-
events {
|
18
|
-
# When you need > 8000 * cpu_cores connections, you start optimizing
|
19
|
-
# your OS, and this is probably the point at where you hire people
|
20
|
-
# who are smarter than you, this is *a lot* of requests.
|
21
|
-
worker_connections 8000;
|
22
|
-
|
23
|
-
# This sets up some smart queueing for accept(2)'ing requests
|
24
|
-
# Set it to "on" if you have > worker_processes
|
25
|
-
accept_mutex off;
|
26
|
-
|
27
|
-
# These settings are OS specific, by defualt Nginx uses select(2),
|
28
|
-
# however, for a large number of requests epoll(2) and kqueue(2)
|
29
|
-
# are generally faster than the default (select(2))
|
30
|
-
# use epoll; # enable for Linux 2.6+
|
31
|
-
# use kqueue; # enable for *BSD (FreeBSD, OS X, ..)
|
32
|
-
}
|
33
|
-
|
34
|
-
# Change these paths to somewhere that suits you!
|
35
|
-
error_log logs/error.log;
|
36
|
-
pid logs/nginx.pid;
|
37
|
-
|
38
|
-
http {
|
39
|
-
# Set the mime-types
|
40
|
-
include mime.types;
|
41
|
-
|
42
|
-
# And the fallback mime-type
|
43
|
-
default_type application/octet-stream;
|
44
|
-
|
45
|
-
# Format for our log files
|
46
|
-
log_format main '$remote_addr - $remote_user [$time_local] $status '
|
47
|
-
'"$request" $body_bytes_sent "$http_referer" '
|
48
|
-
'"$http_user_agent" "$http_x_forwarded_for"';
|
49
|
-
|
50
|
-
# Click tracking!
|
51
|
-
access_log logs/access.log main;
|
52
|
-
|
53
|
-
# ~2 seconds is often enough for HTML/CSS, but connections in
|
54
|
-
# Nginx are cheap, so generally it's safe to increase it
|
55
|
-
keepalive_timeout 5;
|
56
|
-
|
57
|
-
# You usually want to serve static files with Nginx
|
58
|
-
sendfile on;
|
59
|
-
|
60
|
-
tcp_nopush on; # off may be better for Comet/long-poll stuff
|
61
|
-
tcp_nodelay off; # on may be better for Comet/long-poll stuff
|
62
|
-
|
63
|
-
# Enable Gzip
|
64
|
-
gzip on;
|
65
|
-
gzip_http_version 1.0;
|
66
|
-
gzip_comp_level 2;
|
67
|
-
gzip_min_length 1100;
|
68
|
-
gzip_buffers 4 8k;
|
69
|
-
gzip_proxied any;
|
70
|
-
gzip_types text/plain text/xml application/xml application/xml+rss text/css text/javascript application/javascript application/json;
|
71
|
-
|
72
|
-
gzip_static on;
|
73
|
-
|
74
|
-
gzip_proxied expired no-cache no-store private auth;
|
75
|
-
gzip_disable "MSIE [1-6]\.";
|
76
|
-
gzip_vary on;
|
77
|
-
|
78
|
-
server {
|
79
|
-
# listen 80 default deferred; # for Linux
|
80
|
-
# listen 80 default accept_filter=httpready; # for FreeBSD
|
81
|
-
listen 80 default;
|
82
|
-
|
83
|
-
# e.g. "localhost" to accept all connections, or "www.example.com"
|
84
|
-
# to handle the requests for "example.com" (and www.example.com)
|
85
|
-
server_name _;
|
86
|
-
|
87
|
-
# Path for static files
|
88
|
-
root /sites/example.com/public;
|
89
|
-
|
90
|
-
expires 1M;
|
91
|
-
|
92
|
-
# Static assets
|
93
|
-
location ~* ^.+\.(manifest)$ {
|
94
|
-
expires -1;
|
95
|
-
root /sites/example.com/public;
|
96
|
-
access_log logs/static.log;
|
97
|
-
}
|
98
|
-
|
99
|
-
location ~* ^.+\.(ico|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
|
100
|
-
# Only set expires max IFF the file is a static file and exists
|
101
|
-
if (-f $request_filename) {
|
102
|
-
expires max;
|
103
|
-
root /sites/example.com/public;
|
104
|
-
access_log logs/static.log;
|
105
|
-
}
|
106
|
-
}
|
107
|
-
}
|
108
|
-
}
|