html5-starter 0.1.4b → 0.1.8b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +11 -113
- data/stylesheets/html5-boilerplate/_fonts.scss +4 -4
- data/stylesheets/html5-boilerplate/_handheld.scss +3 -3
- data/stylesheets/html5-boilerplate/_helpers.scss +14 -7
- data/stylesheets/html5-boilerplate/_print.scss +2 -2
- data/stylesheets/html5-boilerplate/_reset.scss +8 -8
- data/stylesheets/html5-boilerplate/_styles.scss +16 -31
- data/templates/project/files/404.html +37 -21
- data/templates/project/files/apple-touch-icon-114x114-precomposed.png +0 -0
- data/templates/project/files/apple-touch-icon-57x57-precomposed.png +0 -0
- data/templates/project/files/apple-touch-icon-72x72-precomposed.png +0 -0
- data/templates/project/files/apple-touch-icon-precomposed.png +0 -0
- data/templates/project/files/apple-touch-icon.png +0 -0
- data/templates/project/files/build/build.xml +813 -628
- data/templates/project/files/build/config/buildinfo.properties +5 -0
- data/templates/project/files/build/config/default.properties +22 -21
- data/templates/project/files/build/config/project.properties +9 -8
- data/templates/project/files/build/createproject.sh +29 -52
- data/templates/project/files/build/runbuildscript.bat +5 -0
- data/templates/project/files/build/tools/htmlcompressor-1.1.jar +0 -0
- data/templates/project/files/build/tools/{yuicompressor-2.4.2.jar → yuicompressor-2.4.5.jar} +0 -0
- data/templates/project/files/gitignore.txt +6 -0
- data/templates/project/files/htaccess +71 -8
- data/templates/project/index.html +30 -31
- data/templates/project/javascripts/libs/dd_belatedpng.js +1 -1
- data/templates/project/javascripts/libs/{jquery-1.5.0.js → jquery-1.5.1.js} +549 -409
- data/templates/project/javascripts/libs/jquery-1.5.1.min.js +16 -0
- data/templates/project/javascripts/libs/modernizr-1.7.min.js +2 -0
- data/templates/project/javascripts/plugins.js +3 -1
- data/templates/project/manifest.rb +22 -59
- data/templates/project/style.scss +17 -0
- metadata +15 -44
- data/templates/project/files/build/config/build.properties +0 -3
- data/templates/project/files/build/tools/css-compressor/CSSCompression.php +0 -465
- data/templates/project/files/build/tools/css-compressor/changelog.txt +0 -22
- data/templates/project/files/build/tools/css-compressor/cli.php +0 -101
- data/templates/project/files/build/tools/css-compressor/helpers/hex2short-colors.json +0 -39
- data/templates/project/files/build/tools/css-compressor/helpers/hex2short-safe.json +0 -16
- data/templates/project/files/build/tools/css-compressor/helpers/long2hex-colors.json +0 -127
- data/templates/project/files/build/tools/css-compressor/lib/Cleanup.php +0 -218
- data/templates/project/files/build/tools/css-compressor/lib/Color.php +0 -199
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Aural.php +0 -109
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Background.php +0 -107
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Border.php +0 -98
- data/templates/project/files/build/tools/css-compressor/lib/Combine/BorderOutline.php +0 -109
- data/templates/project/files/build/tools/css-compressor/lib/Combine/BorderRadius.php +0 -262
- data/templates/project/files/build/tools/css-compressor/lib/Combine/Font.php +0 -125
- data/templates/project/files/build/tools/css-compressor/lib/Combine/List.php +0 -104
- data/templates/project/files/build/tools/css-compressor/lib/Combine/MarginPadding.php +0 -190
- data/templates/project/files/build/tools/css-compressor/lib/Combine.php +0 -191
- data/templates/project/files/build/tools/css-compressor/lib/Compress.php +0 -212
- data/templates/project/files/build/tools/css-compressor/lib/Control.php +0 -236
- data/templates/project/files/build/tools/css-compressor/lib/Exception.php +0 -32
- data/templates/project/files/build/tools/css-compressor/lib/Format.php +0 -187
- data/templates/project/files/build/tools/css-compressor/lib/Individuals.php +0 -307
- data/templates/project/files/build/tools/css-compressor/lib/Numeric.php +0 -103
- data/templates/project/files/build/tools/css-compressor/lib/Option.php +0 -133
- data/templates/project/files/build/tools/css-compressor/lib/Organize.php +0 -149
- data/templates/project/files/build/tools/css-compressor/lib/Selectors.php +0 -245
- data/templates/project/files/build/tools/css-compressor/lib/Setup.php +0 -292
- data/templates/project/files/build/tools/css-compressor/lib/Trim.php +0 -213
- data/templates/project/files/build/tools/css-compressor/license.txt +0 -21
- data/templates/project/files/build/tools/htmlcompressor-0.9.8.jar +0 -0
- data/templates/project/files/google.yml +0 -22
- 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/libs/jquery-1.5.0.min.js +0 -16
- data/templates/project/javascripts/libs/modernizr-1.6.min.js +0 -30
@@ -1,213 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
/**
|
3
|
-
* CSS Compressor [VERSION]
|
4
|
-
* [DATE]
|
5
|
-
* Corey Hart @ http://www.codenothing.com
|
6
|
-
*/
|
7
|
-
|
8
|
-
Class CSSCompression_Trim
|
9
|
-
{
|
10
|
-
/**
|
11
|
-
* Trim Patterns
|
12
|
-
*
|
13
|
-
* @class Control: Compression Controller
|
14
|
-
* @param (array) options: Reference to options
|
15
|
-
* @param (regex) rcmark: Marking point when traversing through sheet for comments
|
16
|
-
* @param (regex) rendcomment: Finds the ending comment point
|
17
|
-
* @param (regex) rendquote: Finds the ending quote point
|
18
|
-
* @param (regex) rendsinglequote: Finds the ending single quote point
|
19
|
-
* @param (array) rescape: Array of patterns of groupings that should be escaped
|
20
|
-
* @param (array) trimmings: Stylesheet trimming patterns/replacements
|
21
|
-
* @param (array) escaped: Array of characters that need to be escaped
|
22
|
-
*/
|
23
|
-
private $Control;
|
24
|
-
private $options = array();
|
25
|
-
private $rcmark = "/((?<!\\\)\/\*|(?<!\\\)\"|(?<!\\\)')/";
|
26
|
-
private $rendcomment = "/\*\//";
|
27
|
-
private $rendquote = "/(?<!\\\)\"/";
|
28
|
-
private $rendsinglequote = "/(?<!\\\)'/";
|
29
|
-
private $rescape = array(
|
30
|
-
"/(url\()([^'\"].*?)(\))/is",
|
31
|
-
"/((?<!\\\)\")(.*?)((?<!\\\)\")/s",
|
32
|
-
"/((?<!\\\)')(.*?)((?<!\\\)')/s",
|
33
|
-
);
|
34
|
-
private $trimmings = array(
|
35
|
-
'patterns' => array(
|
36
|
-
"/(?<!\\\)(\s+)?(?<!\\\)([!,{};>\~\+\/])(?<!\\\)(\s+)?/s", // Remove un-needed spaces around special characters
|
37
|
-
"/url\((?<!\\\)\"(.*?)(?<!\\\)\"\)/is", // Remove quotes from urls
|
38
|
-
"/url\((?<!\\\)'(.*?)(?<!\\\)'\)/is", // Remove single quotes from urls
|
39
|
-
"/url\((.*?)\)/is", // Lowercase url wrapper
|
40
|
-
"/(?<!\\\);{2,}/", // Remove unecessary semi-colons
|
41
|
-
"/(?<!\\\)\s+/s", // Compress all spaces into single space
|
42
|
-
),
|
43
|
-
'replacements' => array(
|
44
|
-
'$2',
|
45
|
-
'url($1)',
|
46
|
-
'url($1)',
|
47
|
-
'url($1)',
|
48
|
-
';',
|
49
|
-
' ',
|
50
|
-
)
|
51
|
-
);
|
52
|
-
private $escaped = array(
|
53
|
-
'search' => array(
|
54
|
-
":",
|
55
|
-
";",
|
56
|
-
"}",
|
57
|
-
"{",
|
58
|
-
"@",
|
59
|
-
"!",
|
60
|
-
",",
|
61
|
-
">",
|
62
|
-
"+",
|
63
|
-
"~",
|
64
|
-
"/",
|
65
|
-
"*",
|
66
|
-
".",
|
67
|
-
"=",
|
68
|
-
"#",
|
69
|
-
"\r",
|
70
|
-
"\n",
|
71
|
-
"\t",
|
72
|
-
" ",
|
73
|
-
),
|
74
|
-
'replace' => array(
|
75
|
-
"\\:",
|
76
|
-
"\\;",
|
77
|
-
"\\}",
|
78
|
-
"\\{",
|
79
|
-
"\\@",
|
80
|
-
"\\!",
|
81
|
-
"\\,",
|
82
|
-
"\\>",
|
83
|
-
"\\+",
|
84
|
-
"\\~",
|
85
|
-
"\\/",
|
86
|
-
"\\*",
|
87
|
-
"\\.",
|
88
|
-
"\\=",
|
89
|
-
"\\#",
|
90
|
-
"\\r",
|
91
|
-
"\\n",
|
92
|
-
"\\t",
|
93
|
-
"\\ ",
|
94
|
-
),
|
95
|
-
);
|
96
|
-
|
97
|
-
/**
|
98
|
-
* Stash a reference to the controller on each instantiation
|
99
|
-
*
|
100
|
-
* @param (class) control: CSSCompression Controller
|
101
|
-
*/
|
102
|
-
public function __construct( CSSCompression_Control $control ) {
|
103
|
-
$this->Control = $control;
|
104
|
-
$this->options = &$control->Option->options;
|
105
|
-
}
|
106
|
-
|
107
|
-
/**
|
108
|
-
* Central trim handler
|
109
|
-
*
|
110
|
-
* @param (string) css: Stylesheet to trim
|
111
|
-
*/
|
112
|
-
public function trim( $css ) {
|
113
|
-
$css = $this->comments( $css );
|
114
|
-
$css = $this->escape( $css );
|
115
|
-
$css = $this->strip( $css );
|
116
|
-
return $css;
|
117
|
-
}
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Does a quick run through the script to remove all comments from the sheet,
|
121
|
-
*
|
122
|
-
* @param (string) css: Stylesheet to trim
|
123
|
-
*/
|
124
|
-
private function comments( $css ) {
|
125
|
-
$pos = 0;
|
126
|
-
while ( preg_match( $this->rcmark, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
|
127
|
-
switch ( $match[ 1 ][ 0 ] ) {
|
128
|
-
// Start of comment block
|
129
|
-
case "/*":
|
130
|
-
if ( preg_match( $this->rendcomment, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
|
131
|
-
$end = $m[ 0 ][ 1 ] - $match[ 1 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
|
132
|
-
$css = substr_replace( $css, '', $match[ 1 ][ 1 ], $end );
|
133
|
-
$pos = $match[ 0 ][ 1 ];
|
134
|
-
}
|
135
|
-
else {
|
136
|
-
$css = substr( $css, 0, $match[ 1 ][ 1 ] );
|
137
|
-
break 2;
|
138
|
-
}
|
139
|
-
break;
|
140
|
-
// Start of string
|
141
|
-
case "\"":
|
142
|
-
if ( preg_match( $this->rendquote, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
|
143
|
-
$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
|
144
|
-
}
|
145
|
-
else {
|
146
|
-
break 2;
|
147
|
-
}
|
148
|
-
break;
|
149
|
-
// Start of string
|
150
|
-
case "'":
|
151
|
-
if ( preg_match( $this->rendsinglequote, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
|
152
|
-
$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
|
153
|
-
}
|
154
|
-
else {
|
155
|
-
break 2;
|
156
|
-
}
|
157
|
-
break;
|
158
|
-
// Should have never gotten here
|
159
|
-
default:
|
160
|
-
break 2;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
return $css;
|
165
|
-
}
|
166
|
-
|
167
|
-
/**
|
168
|
-
* Escape out possible splitter characters within urls
|
169
|
-
*
|
170
|
-
* @param (string) css: Full stylesheet
|
171
|
-
*/
|
172
|
-
private function escape( $css ) {
|
173
|
-
foreach ( $this->rescape as $regex ) {
|
174
|
-
$start = 0;
|
175
|
-
while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $start ) ) {
|
176
|
-
$value = $match[ 1 ][ 0 ]
|
177
|
-
. str_replace( $this->escaped['search'], $this->escaped['replace'], $match[ 2 ][ 0 ] )
|
178
|
-
. $match[ 3 ][ 0 ];
|
179
|
-
$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
|
180
|
-
$start = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
|
181
|
-
}
|
182
|
-
}
|
183
|
-
|
184
|
-
return $css;
|
185
|
-
}
|
186
|
-
|
187
|
-
/**
|
188
|
-
* Runs initial formatting to setup for compression
|
189
|
-
*
|
190
|
-
* @param (string) css: CSS Contents
|
191
|
-
*/
|
192
|
-
private function strip( $css ) {
|
193
|
-
// Run replacements
|
194
|
-
return trim( preg_replace( $this->trimmings['patterns'], $this->trimmings['replacements'], $css ) );
|
195
|
-
}
|
196
|
-
|
197
|
-
/**
|
198
|
-
* Access to private methods for testing
|
199
|
-
*
|
200
|
-
* @param (string) method: Method to be called
|
201
|
-
* @param (array) args: Array of paramters to be passed in
|
202
|
-
*/
|
203
|
-
public function access( $method, $args ) {
|
204
|
-
if ( method_exists( $this, $method ) ) {
|
205
|
-
return call_user_func_array( array( $this, $method ), $args );
|
206
|
-
}
|
207
|
-
else {
|
208
|
-
throw new CSSCompression_Exception( "Unknown method in Trim Class - " . $method );
|
209
|
-
}
|
210
|
-
}
|
211
|
-
};
|
212
|
-
|
213
|
-
?>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2011 Corey Hart
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
Binary file
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# Html5BoilerplateHelper will first check your ENV and
|
2
|
-
# then this yml file for these values. If they are both
|
3
|
-
# empty, the google code block will not be used.
|
4
|
-
#
|
5
|
-
# e.g. ENV['GOOGLE_ACCOUNT_ID'] || yml[:google_account_id]
|
6
|
-
# e.g. ENV['GOOGLE_API_KEY'] || yml[:google_api_key]
|
7
|
-
#
|
8
|
-
defaults: &defaults
|
9
|
-
:google_account_id: ''
|
10
|
-
:google_api_key: ''
|
11
|
-
|
12
|
-
:development:
|
13
|
-
<<: *defaults
|
14
|
-
|
15
|
-
:test:
|
16
|
-
<<: *defaults
|
17
|
-
|
18
|
-
:staging:
|
19
|
-
<<: *defaults
|
20
|
-
|
21
|
-
:production:
|
22
|
-
<<: *defaults
|
@@ -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
|
-
}
|