Additional Nginx tweaks
This commit is contained in:
@@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
### v3.9.x - [Unreleased]
|
### v3.9.x - [Unreleased]
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- Extra Nginx directives moved from nginx.conf to conf.d/tweaks.conf
|
||||||
|
|
||||||
|
#### Fixed
|
||||||
|
|
||||||
|
- MySQLTuner installation
|
||||||
|
|
||||||
### v3.9.8 - 2019-08-16
|
### v3.9.8 - 2019-08-16
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|||||||
@@ -179,6 +179,14 @@ def post_pref(self, apt_packages, packages):
|
|||||||
(data), 'brotli.mustache', out=wo_nginx)
|
(data), 'brotli.mustache', out=wo_nginx)
|
||||||
wo_nginx.close()
|
wo_nginx.close()
|
||||||
|
|
||||||
|
Log.debug(self, 'Writting the nginx configuration to '
|
||||||
|
'file /etc/nginx/conf.d/tweaks.conf')
|
||||||
|
wo_nginx = open('/etc/nginx/conf.d/tweaks.conf',
|
||||||
|
encoding='utf-8', mode='w')
|
||||||
|
self.app.render(
|
||||||
|
(data), 'tweaks.mustache', out=wo_nginx)
|
||||||
|
wo_nginx.close()
|
||||||
|
|
||||||
# Fix for white screen death with NGINX PLUS
|
# Fix for white screen death with NGINX PLUS
|
||||||
if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params',
|
if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params',
|
||||||
'SCRIPT_FILENAME'):
|
'SCRIPT_FILENAME'):
|
||||||
|
|||||||
@@ -15,23 +15,11 @@ events {
|
|||||||
|
|
||||||
|
|
||||||
http {
|
http {
|
||||||
|
|
||||||
##
|
##
|
||||||
# WordOps Settings
|
# WordOps Settings
|
||||||
##
|
##
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
sendfile_max_chunk 512k;
|
|
||||||
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
|
|
||||||
keepalive_timeout 8;
|
|
||||||
keepalive_requests 500;
|
|
||||||
keepalive_disable msie6;
|
|
||||||
|
|
||||||
lingering_time 20s;
|
|
||||||
lingering_timeout 5s;
|
|
||||||
|
|
||||||
# Nginx AIO : See - https://www.nginx.com/blog/thread-pools-boost-performance-9x/
|
# Nginx AIO : See - https://www.nginx.com/blog/thread-pools-boost-performance-9x/
|
||||||
# http://nginx.org/en/docs/http/ngx_http_core_module.html#aio
|
# http://nginx.org/en/docs/http/ngx_http_core_module.html#aio
|
||||||
aio threads;
|
aio threads;
|
||||||
@@ -40,13 +28,7 @@ http {
|
|||||||
reset_timedout_connection on;
|
reset_timedout_connection on;
|
||||||
more_set_headers "X-Powered-By : WordOps";
|
more_set_headers "X-Powered-By : WordOps";
|
||||||
|
|
||||||
open_file_cache max=50000 inactive=60s;
|
# Limit Request
|
||||||
open_file_cache_errors off;
|
|
||||||
open_file_cache_min_uses 2;
|
|
||||||
open_file_cache_valid 120s;
|
|
||||||
open_log_file_cache max=10000 inactive=30s min_uses=2;
|
|
||||||
|
|
||||||
# Limit Request
|
|
||||||
limit_req_status 403;
|
limit_req_status 403;
|
||||||
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
|
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
|
||||||
|
|
||||||
@@ -63,7 +45,6 @@ http {
|
|||||||
# tls dynamic records patch directive
|
# tls dynamic records patch directive
|
||||||
ssl_dyn_rec_enable on;
|
ssl_dyn_rec_enable on;
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# SSL Settings
|
# SSL Settings
|
||||||
##
|
##
|
||||||
|
|||||||
30
wo/cli/templates/tweaks.mustache
Normal file
30
wo/cli/templates/tweaks.mustache
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# NGINX Tweaks - WO v3.9.8
|
||||||
|
directio 4m;
|
||||||
|
directio_alignment 512;
|
||||||
|
http2_max_field_size 16k;
|
||||||
|
http2_max_header_size 32k;
|
||||||
|
|
||||||
|
large_client_header_buffers 8 64k;
|
||||||
|
|
||||||
|
postpone_output 1460;
|
||||||
|
proxy_buffers 8 32k;
|
||||||
|
proxy_buffer_size 64k;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
sendfile_max_chunk 512k;
|
||||||
|
|
||||||
|
tcp_nopush on;
|
||||||
|
tcp_nodelay on;
|
||||||
|
|
||||||
|
keepalive_timeout 8;
|
||||||
|
keepalive_requests 500;
|
||||||
|
keepalive_disable msie6;
|
||||||
|
|
||||||
|
lingering_time 20s;
|
||||||
|
lingering_timeout 5s;
|
||||||
|
|
||||||
|
open_file_cache max=50000 inactive=60s;
|
||||||
|
open_file_cache_errors off;
|
||||||
|
open_file_cache_min_uses 2;
|
||||||
|
open_file_cache_valid 120s;
|
||||||
|
open_log_file_cache max=10000 inactive=30s min_uses=2;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# NGINX UPSTREAM CONFIGURATION - WO v3.9.7
|
# NGINX UPSTREAM CONFIGURATION - WO v3.9.8
|
||||||
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
# PHP 5.6
|
# PHP 5.6
|
||||||
|
|||||||
Reference in New Issue
Block a user