【发布时间】:2022-04-26 09:02:30
【问题描述】:
用 php、mysql 等安装了我的旧站点,一切正常,但我的站点无法从我的局域网外部访问。进行了大量更改并为我的 nginx 站点启用和 php7.4 尝试了至少 100 个配置,但没有任何帮助:/。我收到 502 或连接被拒绝错误。在 ubuntu 20.04 上运行
检查这个默认容器:
server {
listen 80;
root /var/www;
index index.html index.php index.htm index.nginx-debian.html;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
#fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
include snippets/fastcgi-php.conf;
#fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
和 php www.conf(都测试过):
...
;listen = /var/run/php/php7.4-fpm.sock
listen = 0.0.0.0:9000
...
netstat -lntp:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN 9194/php-fpm: maste
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1086/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9151/nginx: master
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 795/systemd-resolve
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 900/cupsd
tcp 0 0 127.0.0.1:9050 0.0.0.0:* LISTEN 1038/tor
tcp6 0 0 :::33060 :::* LISTEN 1086/mysqld
tcp6 0 0 ::1:631 :::* LISTEN 900/cupsd
你们有什么提示,我可能会错过吗?
最好的问候和对不起我的英语不好
【问题讨论】: