我已经获得了一台 CentOS 8 机器的访问权限,该机器已经在端口 80 上运行了一个 Web。我已检查过没有运行防火墙(无论是防火墙还是 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 {
# }
# }
}
本地访问时显示Nginx默认页面,但是从另一台机器尝试访问网页(192.XXX.XXX.XXX:55555)时,发现80端口已经开放,可以访问,但是55555端口没有开放。
为了配置 Nginx 以从外部访问时检索默认网页,我缺少什么线索?