-1
這適用於fastcgi_cache結合別名:不能在Nginx的
location ~ ^/special/(.+\.php)$ {
alias /var/special/$1;
try_files "" =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000; # php-fpm socket
}
但這並不:
location ~ ^/special/(.+\.php)$ {
alias /var/special/$1;
try_files "" =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000; # php-fpm socket
fastcgi_cache mycache;
}
如果我試圖去URL「/special/index.php 「我收到了」找不到文件「。瀏覽器中的文本,我假設它來自php-fpm或PHP。而我在Nginx日誌中得到這個錯誤:
FastCGI sent in stderr: "Primary script unknown", client: 202.179.27.65, server: myserver.org, request: "GET /special/index.php HTTP/1.1", host: "myserver.org"
任何想法爲什麼添加fastcgi_cache打破了這一點?
請注意,當我使用而不是使用別名的位置時,fastcgi_cache可以正常工作。 (!)