|
|
@ -1514,15 +1514,15 @@ class sites(object): |
|
|
|
return mw.returnData(False, "代理目录已存在!!") |
|
|
|
return mw.returnData(False, "代理目录已存在!!") |
|
|
|
|
|
|
|
|
|
|
|
tpl = "#PROXY-START\n\ |
|
|
|
tpl = "#PROXY-START\n\ |
|
|
|
location ^~ {from} {\n \ |
|
|
|
location ^~ {from} {\n\ |
|
|
|
add_header X-Cache $upstream_cache_status;\n \ |
|
|
|
add_header X-Cache $upstream_cache_status;\n\ |
|
|
|
{cors}\n\ |
|
|
|
{cors}\n\ |
|
|
|
proxy_pass {to};\n \ |
|
|
|
proxy_pass {to};\n\ |
|
|
|
proxy_set_header Host {host};\n \ |
|
|
|
proxy_set_header Host {host};\n\ |
|
|
|
proxy_ssl_server_name on;\n \ |
|
|
|
proxy_ssl_server_name on;\n\ |
|
|
|
proxy_set_header X-Real-IP $remote_addr;\n \ |
|
|
|
proxy_set_header X-Real-IP $remote_addr;\n\ |
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n \ |
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\ |
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;\n \ |
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;\n\ |
|
|
|
proxy_set_header Upgrade $http_upgrade;\n\ |
|
|
|
proxy_set_header Upgrade $http_upgrade;\n\ |
|
|
|
proxy_set_header Connection $connection_upgrade;\n\ |
|
|
|
proxy_set_header Connection $connection_upgrade;\n\ |
|
|
|
proxy_http_version 1.1;\n\ |
|
|
|
proxy_http_version 1.1;\n\ |
|
|
@ -1532,26 +1532,26 @@ location ^~ {from} {\n \ |
|
|
|
# PROXY-END" |
|
|
|
# PROXY-END" |
|
|
|
|
|
|
|
|
|
|
|
tpl_proxy_cache = "\n\ |
|
|
|
tpl_proxy_cache = "\n\ |
|
|
|
if ( $uri ~* \\.(gif|png|jpg|css|js|woff|woff2)$\" )\n \ |
|
|
|
if ( $uri ~* \\.(gif|png|jpg|css|js|woff|woff2)$\" )\n\ |
|
|
|
{\n \ |
|
|
|
{\n\ |
|
|
|
expires {cache_time}m;\n \ |
|
|
|
expires {cache_time}m;\n\ |
|
|
|
}\n \ |
|
|
|
}\n\ |
|
|
|
proxy_ignore_headers Set-Cookie Cache-Control expires;\n \ |
|
|
|
proxy_ignore_headers Set-Cookie Cache-Control expires;\n\ |
|
|
|
proxy_cache mw_cache;\n \ |
|
|
|
proxy_cache mw_cache;\n \ |
|
|
|
proxy_cache_key \"$host$uri$is_args$args\";\n \ |
|
|
|
proxy_cache_key \"$host$uri$is_args$args\";\n\ |
|
|
|
proxy_cache_valid 200 304 301 302 {cache_time}m;\n\ |
|
|
|
proxy_cache_valid 200 304 301 302 {cache_time}m;\n\ |
|
|
|
" |
|
|
|
" |
|
|
|
|
|
|
|
|
|
|
|
tpl_proxy_nocache = "\n\ |
|
|
|
tpl_proxy_nocache = "\n\ |
|
|
|
set $static_files_app 0; \n \ |
|
|
|
set $static_files_app 0; \n \ |
|
|
|
if ( $uri ~* \\.(gif|png|jpg|css|js|woff|woff2)$\" )\n \ |
|
|
|
if ( $uri ~* \\.(gif|png|jpg|css|js|woff|woff2)$\" )\n\ |
|
|
|
{\n \ |
|
|
|
{\n\ |
|
|
|
set $static_files_app 1;\n\ |
|
|
|
set $static_files_app 1;\n\ |
|
|
|
expires 12h;\n\ |
|
|
|
expires 12h;\n\ |
|
|
|
}\n \ |
|
|
|
}\n\ |
|
|
|
if ( $static_files_app = 0 )\n \ |
|
|
|
if ( $static_files_app = 0 )\n\ |
|
|
|
{\n \ |
|
|
|
{\n\ |
|
|
|
add_header Cache-Control no-cache;\n \ |
|
|
|
add_header Cache-Control no-cache;\n\ |
|
|
|
}\n\ |
|
|
|
}\n\ |
|
|
|
" |
|
|
|
" |
|
|
|
tpl_proxy_cors = "\n\ |
|
|
|
tpl_proxy_cors = "\n\ |
|
|
|