From d130bedea698343762f231347c384f2c2a1373f8 Mon Sep 17 00:00:00 2001 From: HITSword Date: Thu, 9 Jan 2020 15:54:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AF=E7=8B=AC=E7=AB=8B=E6=97=A5?= =?UTF-8?q?=E5=BF=97.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HITSword --- hyproxy-cli.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/hyproxy-cli.php b/hyproxy-cli.php index a8f6a3b..56304fa 100644 --- a/hyproxy-cli.php +++ b/hyproxy-cli.php @@ -97,11 +97,6 @@ function hyproxy_make($server_name){//done server_name %s; index %s; - #error_page - location /ErrorPages/ { - alias /home/wwwroot/index/etc/html/ErrorPages/; - } - location / { default_type text/html; proxy_cache hyproxy; @@ -117,7 +112,9 @@ function hyproxy_make($server_name){//done location ~ /purge(/.*){ proxy_cache_purge hyproxy $scheme://$host$1$is_args$args; } -}',$value['server_name'],$value['index'],$value['header_host'],$value['proxy_pass']); + access_log /usr/local/nginx/logs/%s.access.log combined; #access_log end + error_log /usr/local/nginx/logs/%s.error.log crit; #error_log end +}',$value['server_name'],$value['index'],$value['header_host'],$value['proxy_pass'],$value['server_name'],$value['server_name']); } else { $nginx = sprintf('server { listen 80; @@ -125,11 +122,6 @@ function hyproxy_make($server_name){//done server_name %s; index %s; - #error_page - location /ErrorPages/ { - alias /home/wwwroot/index/etc/html/ErrorPages/; - } - location / { default_type text/html; proxy_set_header X-Real-IP $remote_addr; @@ -137,7 +129,9 @@ function hyproxy_make($server_name){//done proxy_set_header Host %s; proxy_pass %s; } -}',$value['server_name'],$value['index'],$value['header_host'],$value['proxy_pass']); + access_log /usr/local/nginx/logs/%s.access.log combined; #access_log end + error_log /usr/local/nginx/logs/%s.error.log crit; #error_log end +}',$value['server_name'],$value['index'],$value['header_host'],$value['proxy_pass'],$value['server_name'],$value['server_name']); } if ($value['status']=='start') { $filebytes = file_put_contents(_HYCONF.$value['server_name'].'.conf', $nginx); //写入内容