小编Alb*_*n N的帖子

nginx 默认 root 在端口 80 上返回 404

当我尝试仅通过端口 80 上的 IP 访问我的服务器时遇到问题。

如果我访问该 IP,我会收到 nginx 404 错误页面。

这是我的默认配置:

# You may add here your
# server {
#       ...
# }
# statements for each of your virtual hosts to this file


server {
        listen    80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default ipv6only=on; ## listen for ipv6
        # Document root
        root /var/www/default;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name localhost;

        location / {
                # First attempt to …
Run Code Online (Sandbox Code Playgroud)

nginx

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

nginx ×1