优化代码。

Signed-off-by: HITSword <admin@huayizhiyun.com>
This commit is contained in:
HITSword
2020-01-09 17:21:19 +08:00
parent d130bedea6
commit 0331af549d
5 changed files with 357 additions and 268 deletions
+18
View File
@@ -0,0 +1,18 @@
#禁用反向代理缓存模板
server {
listen 80;
listen [::]:80;
server_name {$server_name};
index {$index};
location / {
default_type text/html;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host {$header_host};
proxy_pass {$proxy_pass};
}
access_log {$logs_path}.access.log combined; #access_log end
error_log {$logs_path}.error.log crit; #error_log end
}
+26
View File
@@ -0,0 +1,26 @@
#启用反向代理缓存模板
server {
listen 80;
listen [::]:80;
server_name {$server_name};
index {$index};
location / {
default_type text/html;
proxy_cache hyproxy;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host {$header_host};
proxy_pass {$proxy_pass};
if ($http_Cache_Control = "no-cache") {
rewrite ^(.*)$ /purge$1 last;
}
}
location ~ /purge(/.*){
proxy_cache_purge hyproxy $scheme://$host$1$is_args$args;
}
access_log {$logs_path}.access.log combined; #access_log end
error_log {$logs_path}.error.log crit; #error_log end
}