gpt4 book ai didi

nginx - 设置 Nginx : port appears as not opened

转载 作者:行者123 更新时间:2023-12-04 19:35:20 25 4
gpt4 key购买 nike

我已经获得了对 CentOS 8 机器的访问权限,该机器已经在端口 80 上运行了一个网络。我检查了没有防火墙在运行(firewalld 和 ufw 都没有)。我的想法是设置一个在 55555 端口上运行的 Django Web。因此,我想要实现的第一件事是从机器外部显示默认的 Nginx 页面。
目前,我的 Nginx 配置如下:

    include             /etc/nginx/mime.types;
default_type application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;

server {
listen 55555 default_server;
listen [::]:55555 default_server;
server_name _;
root /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

# Settings for a TLS enabled server.
#
# server {
# listen 443 ssl http2 default_server;
# listen [::]:443 ssl http2 default_server;
# server_name _;
# root /usr/share/nginx/html;
#
# ssl_certificate "/etc/pki/nginx/server.crt";
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 10m;
# ssl_ciphers PROFILE=SYSTEM;
# ssl_prefer_server_ciphers on;
#
# # Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
#
# location / {
# }
#
# error_page 404 /404.html;
# location = /40x.html {
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
# }

}
此外,端口 55555 显示为已打开:
enter image description here
本地访问时显示Nginx默认页面,但是尝试从另一台机器访问网页(192.XXX.XXX.XXX:55555)时,我得到端口80已打开,可以访问但端口55555是没有打开。
为了配置 Nginx 以在从外部访问时检索默认网页,我缺少什么线索?

最佳答案

如果您可以在本地访问端口 55555,则似乎 Nginx 已正确设置,因此我会更仔细地查看网络,可能与您要连接的机器有关,或者阻止该端口允许入站连接

关于nginx - 设置 Nginx : port appears as not opened,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69853863/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com