[英]How to avoid the cache of symlinks in an NGINX reverse proxy?
在 FastCGI 服務器中,我曾經將包含最新代碼的文件夾符號鏈接到current
文件夾,以實現零停機部署。
我使用這些指令來避免符號鏈接的緩存:
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
但是現在我在一個反向代理中並且符號鏈接被緩存了,所以當前運行的代碼不再是最新的。
有沒有辦法避免 NGINX 反向代理中的符號鏈接緩存?
提前感謝您的幫助,NGINX 配置如下所示:
location @octane {
set $suffix "";
if ($uri = /index.php) {
set $suffix ?$query_string;
}
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:8000$suffix;
}
由於 NGINX 僅與反向代理符號鏈接的端口通信,因此不應影響這方面的事情。 您使用的是什么部署系統? 正如我所期望的那樣,停止以前的 Octane 服務器構建( php artisan octane:stop
)並使用php artisan octane:start
加載新構建
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.