0

我正在运行全新的 Debian 9 / nginx 1.10 安装。新主机(poseidon)在我的 DNS 中声明。

我已经设置了一个非常通用的 NGINX 配置

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /home/www/mysite/;
        index index.php index.html;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ \.php$ {
                try_files $uri $uri/ =404;
                fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                fastcgi_param SCRIPT_FILENAME 
 document_root$fastcgi_script_name;
                fastcgi_index index.php;
                include /etc/nginx/fastcgi_params;
        }
}

在 /home/www/mysite 我有一个 index.php 脚本来测试访问实际上是基本的 php 信息

<?php
phpinfo();
?>

在我的浏览器中,使用http://poseidon或它的本地 IP 地址可以正常工作,但是当尝试使用我的外部域名http://www.open-si.orghttp://open-si.org从外部访问时我面临 HTTP 403 错误。

所以我假设我的 isp 路由器上的端口转发是正确的,因为 http 服务器收到了请求(没有找到站点或 http 404 错误),但它失败并出现 Http 403 错误。

将 nging 日志切换为调试似乎此错误可能是由于超时

client timed out (110: Connection timed out) while waiting for request, client: 192.168.1.3, server: 0.0.0.0:80

我用谷歌搜索并发现了许多类似的问题,但没有答案。考虑到一个与超时设置相关的 php-fpm 配置问题,我将一个基本的 html 页面放在 web 根文件夹中,在 Nginx 服务器块中添加 index index.html index.php。

同样的问题 !所以 php-fpm 似乎不在关键路径上。

任何想法 ?

4

0 回答 0