Additional Nginx tweaks

This commit is contained in:
VirtuBox
2019-08-16 22:57:26 +02:00
parent 5b654b64b3
commit aa1a830c5b
5 changed files with 589 additions and 562 deletions

View File

@@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### 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
#### Added

View File

@@ -179,6 +179,14 @@ def post_pref(self, apt_packages, packages):
(data), 'brotli.mustache', out=wo_nginx)
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
if not WOFileUtils.grep(self, '/etc/nginx/fastcgi_params',
'SCRIPT_FILENAME'):

View File

@@ -15,23 +15,11 @@ events {
http {
##
# 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/
# http://nginx.org/en/docs/http/ngx_http_core_module.html#aio
aio threads;
@@ -40,13 +28,7 @@ http {
reset_timedout_connection on;
more_set_headers "X-Powered-By : WordOps";
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;
# Limit Request
# Limit Request
limit_req_status 403;
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
@@ -63,7 +45,6 @@ http {
# tls dynamic records patch directive
ssl_dyn_rec_enable on;
##
# SSL Settings
##

View 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;

View File

@@ -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
#-------------------------------
# PHP 5.6