Skip to content

Commit

Permalink
Removed separate aio and sendfile.
Browse files Browse the repository at this point in the history
Next commit will target nginx 1.9.0
  • Loading branch information
Fleshgrinder committed Apr 29, 2015
1 parent 4a953b1 commit 1df514e
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 77 deletions.
1 change: 0 additions & 1 deletion examples/drupal/sites/com/example.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ server {

location / {
include includes/protect-system-files.ngx;
include includes/fs-aio.ngx;
include includes/static-files.ngx;
include includes/php-fpm-drupal.ngx;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/.static-files-none.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
# ----------------------------------------------------------------------------------------------------------------------

expires -1;
tcp_nodelay off;
sendfile on;
try_files $uri =404;
2 changes: 1 addition & 1 deletion includes/.static-files-one-hour.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

add_header Cache-Control 'public, must-revalidate';
expires 1h;
tcp_nodelay off;
sendfile on;
try_files $uri =404;
2 changes: 1 addition & 1 deletion includes/.static-files-one-month.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ add_header Cache-Control public;
etag off;
expires 1M;
if_modified_since off;
tcp_nodelay off;
sendfile on;
try_files $uri =404;
2 changes: 1 addition & 1 deletion includes/.static-files-one-year.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ add_header Cache-Control public;
etag off;
expires 1y;
if_modified_since off;
tcp_nodelay off;
sendfile on;
try_files $uri =404;
30 changes: 0 additions & 30 deletions includes/fs-aio.ngx

This file was deleted.

29 changes: 0 additions & 29 deletions includes/fs-sendfile.ngx

This file was deleted.

3 changes: 1 addition & 2 deletions includes/headers-hsts.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
# @license https://www.gnu.org/licenses/agpl-3.0.html AGPLv3
# ----------------------------------------------------------------------------------------------------------------------

include includes/headers.ngx;

include includes/headers.ngx;
add_header Strict-Transport-Security 'max-age=262974383; includeSubdomains; preload' always;
2 changes: 1 addition & 1 deletion includes/https.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# @license https://www.gnu.org/licenses/agpl-3.0.html AGPLv3
# ----------------------------------------------------------------------------------------------------------------------

ssl_buffer_size 1400;
ssl_buffer_size 1360;
ssl_ciphers kEECDH+ECDSA:kEECDH:kEDH:HIGH:+SHA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!DSS:!PSK:!RC4:!kRSA:!SRP:!kECDH:!CAMELLIA;
ssl_ecdh_curve prime256v1;
ssl_prefer_server_ciphers on;
Expand Down
10 changes: 9 additions & 1 deletion includes/protect-system-files.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
# @license https://www.gnu.org/licenses/agpl-3.0.html AGPLv3
# ----------------------------------------------------------------------------------------------------------------------

location ~* '(?:(?:^|/)\.|(?:backup|patches|scripts)|(?:\.(?:bak|c(?:on)?fi?g?|dist|fla|inc|ini|ngx|log|psd|sh|sql|swp)|~)$)' {
location /backup {
return 404;
}

location /patches {
return 404;
}

location ~* '(?:(?:^|/)\.|(?:\.(?:bak|cfg|conf|config|dist|fla|inc|ini|ngx|log|psd|sh|sql|swp)|~)$)' {
return 404;
}
8 changes: 4 additions & 4 deletions includes/static-files-hsts.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
# @license https://www.gnu.org/licenses/agpl-3.0.html AGPLv3
# ----------------------------------------------------------------------------------------------------------------------

location ~* '\.(?:css|js)' {
location ~* "\.(?:css|js)$" {
include includes/headers-hsts.ngx;
include includes/.static-files-one-year.ngx;
}

location ~* '(?:/(?:browserconfig|crossdomain)\.xml|\.(?:3gp|cur|eot|gif|htc|ico|jng|jpe?g|mp(?:3|4)|og(?:g|v)|otf|png|svgz?|swf|tiff?|ttc|ttf|txt|wav|web(?:m|p)|woff2?))' {
location ~* "(?:^/(?:browserconfig|crossdomain)\.xml|\.(?:3gp|cur|eot|gif|htc|ico|jng|jpe?g|mp(?:3|4)|og(?:g|v)|otf|png|svgz?|swf|tiff?|ttc|ttf|txt|wav|web(?:m|p)|woff2?))$" {
include includes/headers-hsts.ngx;
include includes/.static-files-one-month.ngx;
}

location ~* '\.(?:rss|atom)' {
location ~* "\.(?:rss|atom)$" {
include includes/headers-hsts.ngx;
include includes/.static-files-one-hour.ngx;
}

location ~* '\.(?:manifest|appcache|html?|xml|json)' {
location ~* "\.(?:manifest|appcache|html?|xml|json)$" {
include includes/headers-hsts.ngx;
include includes/.static-files-none.ngx;
}
8 changes: 4 additions & 4 deletions includes/static-files.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@
# @license https://www.gnu.org/licenses/agpl-3.0.html AGPLv3
# ----------------------------------------------------------------------------------------------------------------------

location ~* '\.(?:css|js)' {
location ~* "\.(?:css|js)$" {
include includes/headers.ngx;
include includes/.static-files-one-year.ngx;
}

location ~* '(?:/(?:browserconfig|crossdomain)\.xml|\.(?:3gp|cur|eot|gif|htc|ico|jng|jpe?g|mp(?:3|4)|og(?:g|v)|otf|png|svgz?|swf|tiff?|ttc|ttf|txt|wav|web(?:m|p)|woff2?))' {
location ~* "(?:^/(?:browserconfig|crossdomain)\.xml|\.(?:3gp|cur|eot|gif|htc|ico|jng|jpe?g|mp(?:3|4)|og(?:g|v)|otf|png|svgz?|swf|tiff?|ttc|ttf|txt|wav|web(?:m|p)|woff2?))$" {
include includes/headers.ngx;
include includes/.static-files-one-month.ngx;
}

location ~* '\.(?:rss|atom)' {
location ~* "\.(?:rss|atom)$" {
include includes/headers.ngx;
include includes/.static-files-one-hour.ngx;
}

location ~* '\.(?:manifest|appcache|html?|xml|json)' {
location ~* "\.(?:manifest|appcache|html?|xml|json)$" {
include includes/headers.ngx;
include includes/.static-files-none.ngx;
}
5 changes: 4 additions & 1 deletion nginx.dist.ngx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ http {
client_header_timeout 3s;
client_max_body_size 16m;
default_type application/octet-stream;
directio 1m;
ignore_invalid_headers on;
include includes/gzip.ngx;
include includes/headers.ngx;
Expand All @@ -55,7 +56,9 @@ http {
keepalive_timeout 120s;
max_ranges 0;
msie_padding off;
postpone_output 1440;
output_buffers 1 512k; # Should match read_ahead.
postpone_output 1460;
read_ahead 512k; # Should match output_buffers.
recursive_error_pages on;
reset_timedout_connection on;
send_timeout 9s;
Expand Down

0 comments on commit 1df514e

Please sign in to comment.