Php 视窗10-Nginx&;Symfony 3配置
我正在尝试使用Nginx和Symfony 3的一个新项目来设置我的环境,这两个项目本身都可以很好地工作(要么通过启动php-cgi.exe-b 127.0.0.1:9000启动Nginx,要么通过server:run启动Symfony 3项目),但是,我无法让Symfony通过Nginx工作 我在日志中得到的错误消息如下所示:Php 视窗10-Nginx&;Symfony 3配置,php,nginx,symfony,Php,Nginx,Symfony,我正在尝试使用Nginx和Symfony 3的一个新项目来设置我的环境,这两个项目本身都可以很好地工作(要么通过启动php-cgi.exe-b 127.0.0.1:9000启动Nginx,要么通过server:run启动Symfony 3项目),但是,我无法让Symfony通过Nginx工作 我在日志中得到的错误消息如下所示: 2016/02/21 00:36:33 [error] 6260#1732: *1 upstream timed out (10060: A connection att
2016/02/21 00:36:33 [error] 6260#1732: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
这是我在nginx.conf中为服务器部分编写的代码:
server {
listen 80;
server_name localhost;
root www/projects/mysite.com/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
我已将50x.html文件放在我的/web文件夹中,它在超时后确实正确显示…我可以理解您正在使用Unix/Linux计算机。这是因为您尚未启用(授予上游权限) 默认情况下,上游被selinux阻止。请让我知道这是否修复
谢谢。我知道您正在使用Unix/Linux机器。这是因为您尚未启用(授予上游权限) 默认情况下,上游被selinux阻止。请让我知道这是否修复
谢谢。err我在windows上,我编辑了标题以避免混淆:)err我在windows上,我编辑了标题以避免混淆:)
setsebool -P httpd_can_network_connect true