Php try\u文件未使用fastcgi
我正在通过nginx和php fpm运行Wordpress。当请求存在的文件时,它工作正常,但当try_pass尝试将URL重写为index.php时,浏览器只下载php文件的源代码。如何让try_文件将index.php传递给fastcgi 这是我的nginx配置Php try\u文件未使用fastcgi,php,wordpress,nginx,fastcgi,Php,Wordpress,Nginx,Fastcgi,我正在通过nginx和php fpm运行Wordpress。当请求存在的文件时,它工作正常,但当try_pass尝试将URL重写为index.php时,浏览器只下载php文件的源代码。如何让try_文件将index.php传递给fastcgi 这是我的nginx配置 server { listen 80; listen [::]:80; root /home/gausie/mywebsite.com/; index index.p
server {
listen 80;
listen [::]:80;
root /home/gausie/mywebsite.com/;
index index.php;
server_name mywebsite.com;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
我基本上是从nginxwiki上借用了这个,所以我不明白为什么它不起作用 所以。。。由于根本没有对文件进行任何更改,它在等待之后就自行修复了 如果有人知道为什么要花这么长时间工作我会很感激的