From 36d25ed0f8cdc3841065a4c25fca9111ef9f89df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C6=ACHE=20=D0=AFAW=20=E2=98=A3?= Date: Fri, 13 Apr 2018 13:53:03 +0200 Subject: [PATCH] Update default --- static/vhost/default | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/static/vhost/default b/static/vhost/default index 27f6656..8f7e393 100644 --- a/static/vhost/default +++ b/static/vhost/default @@ -4,10 +4,20 @@ server { index index.html; server_name localhost; + # ================================================ # LIMIT CONNECTION FOR IP / IPs WILL BE AUTO BANNED IF YOU HAVE INSTALL IPTABLES/FAIL2BAN limit_conn max 800; limit_req zone=one burst=300 nodelay; + # ================================================ + # ================================================ + # 1. Don't put log files into location / {..} it will not work as you think. Use like this. + # 2. If you change their name or location make sure you also change those https://github.com/theraw/The-World-Is-Yours/blob/master/iptables/jail.local#L105-L118 + access_log /hostdata/default/logs/access.log main; + error_log /hostdata/default/logs/error.log main; + # ================================================ + + # ================================================ location / { SecRulesEnabled; LearningMode; @@ -20,16 +30,13 @@ server { try_files $uri $uri/ =404; } - - access_log /hostdata/default/logs/access.log main; - # ERROR.log path shouldn't be changed! or change this https://github.com/theraw/The-World-Is-Yours/blob/master/iptables/jail.local#L110 - error_log /nginx/logs/error.log; + # ================================================ location /denied/ { return 444; } - + # ================================================ location ~ \.php { try_files $uri /index.php =404; fastcgi_pass 127.0.0.1:9000; @@ -37,4 +44,5 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } + # ================================================ }