0
我試圖設置nginx,所以每個路徑都有自己的根目錄。這是工作的大部分,但是POST到PHP-FPM一個扔一個405nginx每個子目錄有一個獨立的根目錄
目前正在努力:
location ^~ /foo {
alias /www/foo;
#index index.php;
try_files $uri /www/foo/index.php$request_uri;
access_log /var/log/nginx/foo.log main;
error_log /var/log/nginx/foo.log error;
}
location ^~ /bar {
alias /www/bar;
#index index.php;
try_files $uri /www2/bar/index.php$request_uri;
access_log /var/log/nginx/bar.log main;
error_log /var/log/nginx/bar.log error;
}
location ~ \.php {
set $php_root /usr/local/deploy/baz/current/web;
if ($request_uri ~* /foo) {
set $php_root /www/foo/current/web;
}
if ($request_uri ~* /bar) {
set $php_root /www2/bar/current/web;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $php_root;
include fastcgi_params;
}
是否*任何* POST請求到php-fpm拋出405錯誤?如果不是,請說明 – YakovL