如果存在index.php重定向,则在几个请求之后nginx请求超时

如果存在index.php重定向,则在几个请求之后nginx请求超时,php,nginx,vagrant,php-7,Php,Nginx,Vagrant,Php 7,我正在为我的新项目设置一个PHP7 LEMP流浪箱。我以前使用过Apache,所以我需要转换将所有不存在的文件重定向到index.php的规则。我在my/etc/nginx/sites available/mysite中使用了以下内容: location / { try_files $uri $uri/ /index.php?$args; } 添加此项并重新启动nginx后,我可以访问我的站点一次,也许可以导航到另一个站点,但接下来的所有请求都将超时。我

我正在为我的新项目设置一个PHP7 LEMP流浪箱。我以前使用过Apache,所以我需要转换将所有不存在的文件重定向到index.php的规则。我在my/etc/nginx/sites available/mysite中使用了以下内容:

    location / {
            try_files $uri $uri/ /index.php?$args;
    }
添加此项并重新启动nginx后,我可以访问我的站点一次,也许可以导航到另一个站点,但接下来的所有请求都将超时。我先调用哪个URL并不重要,我可以调用任何URL一次

/var/log/nginx/error.log:

[error] 21885#21885: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.13.1, server: myserver.dev, request: "GET /user/me HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock", host: "myserver.dev", referrer: "http://myserver.dev/"
/etc/php/7.0/fpm/php fpm.conf:这里没什么有趣的

网站配置文件

server {
        listen       80;
        server_name  myserver.dev;
        root /vagrant/public_html;
        index index.php index.html index.htm index.nginx-debian.html;
        location / {
                try_files $uri $uri/ /index.php?$args;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /var/www/html;
        }
        location ~ \.php$ {
                 try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

有什么想法吗?

我放弃了。在我使用php5.6的Web服务器上,在激活php5 mcrypt之前,一切都正常运行。如果php5 mcrypt被启用,请求超时。我放弃了这个。在我使用php5.6的Web服务器上,在激活php5 mcrypt之前,一切都正常运行。如果启用php5 mcrypt,则请求超时。