parent
9f50b69cc4
commit
d130bedea6
|
|
@ -97,11 +97,6 @@ function hyproxy_make($server_name){//done
|
||||||
server_name %s;
|
server_name %s;
|
||||||
index %s;
|
index %s;
|
||||||
|
|
||||||
#error_page
|
|
||||||
location /ErrorPages/ {
|
|
||||||
alias /home/wwwroot/index/etc/html/ErrorPages/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
default_type text/html;
|
default_type text/html;
|
||||||
proxy_cache hyproxy;
|
proxy_cache hyproxy;
|
||||||
|
|
@ -117,7 +112,9 @@ function hyproxy_make($server_name){//done
|
||||||
location ~ /purge(/.*){
|
location ~ /purge(/.*){
|
||||||
proxy_cache_purge hyproxy $scheme://$host$1$is_args$args;
|
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 {
|
} else {
|
||||||
$nginx = sprintf('server {
|
$nginx = sprintf('server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
@ -125,11 +122,6 @@ function hyproxy_make($server_name){//done
|
||||||
server_name %s;
|
server_name %s;
|
||||||
index %s;
|
index %s;
|
||||||
|
|
||||||
#error_page
|
|
||||||
location /ErrorPages/ {
|
|
||||||
alias /home/wwwroot/index/etc/html/ErrorPages/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
default_type text/html;
|
default_type text/html;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
@ -137,7 +129,9 @@ function hyproxy_make($server_name){//done
|
||||||
proxy_set_header Host %s;
|
proxy_set_header Host %s;
|
||||||
proxy_pass %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') {
|
if ($value['status']=='start') {
|
||||||
$filebytes = file_put_contents(_HYCONF.$value['server_name'].'.conf', $nginx); //写入内容
|
$filebytes = file_put_contents(_HYCONF.$value['server_name'].'.conf', $nginx); //写入内容
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue