Nginx 别名问题,照片无法显示

Nginx 别名问题,照片无法显示

这是我所拥有的:/usr/share/nginx/htmlNouveau/images/logo.gif 我的照片 logo.gif;/usr/share/nginx/htmlNouveau/index.html 我的 index.html 如下所示:

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>

<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<img src="images/logo.gif" style="width: 400px;"/> 
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

和 /etc/nginx/conf.d/default.conf 我的 default.conf 如下所示:

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;

    location / {
        root   /usr/share/nginx/htmlNouveau;
        index  index.html index.htm;
    }

    location /images/ {
        alias /usr/share/nginx/htmlNouveau/images;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

但是我遇到了一个问题,当我在 localhost 上运行 nginx 时,我的照片没有显示出来。我真的很困惑,有谁能看出我错在哪里吗?谢谢 PS 这是我得到的:http://prntscr.com/8j1y7s

相关内容