Nginx PHP5组合给出403错误 [英] Nginx PHP5 combination gives 403 error
问题描述
我尝试将wordpress实例嵌入到也可以与我已经安装的Rails应用程序一起使用的nginx服务器中.我对使用相同的文字(HOWTO:在Nginx上安装WordPress;没有给出日期),但它为所有请求给出403错误.
I try to embed a wordpress instance to nginx server that also works with my already installed Rails application. I used all the same with that writing (HOWTO: Install WordPress on Nginx; no Date given) but it gives 403 error for all requests.
我如何理解该权限错误的原因.日志不包含更多信息.是关于fast-cgi或任何正在运行的进程的权限问题?
How could I understand the reason of that permission error. Logs does not include further information. Is it about the permission problem on fast-cgi or any running process?
这也是我当前的设置:
server{
listen 80;
server_name www.bla.com bla.com;
root /opt/nginx/wordpress/;
try_files $uri $uri/ /index.php;
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass localhost:53217;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
推荐答案
403是禁止"的HTTP状态代码.
403 is the HTTP status code for "Forbidden".
我建议通过继续简化服务器配置来调试它,直到退出错误为止.问题出在最后删除的内容上. :).
I recommend debugging it by continuing to simplify your server configuration until you quit getting the error. The problem is then in whatever you removed last. :).
例如,您可以临时注释Rails应用程序,看看是否仍然存在问题,然后尝试注释掉我们所有的wordpress服务器{}定义,看看是否仍然存在问题.
For example, you could temporarily comment your rails app and see if you still get the problem, and then try commenting out all our some of your wordpress server{} definition and see if you still have the problem.
我还建议您在nginx配置中搜索单词允许"和拒绝",因为它们用于控制访问.如果拒绝"访问某个位置,则可能会导致403.
I also recommend searching through your nginx configuration for the words 'allow' and 'deny' as they are used to control access. If access is "denied" to a location, it could result in a 403.
这篇关于Nginx PHP5组合给出403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!