Nginx 什么';“中的url匹配有误”;地点“;标签?

Nginx 什么';“中的url匹配有误”;地点“;标签?,nginx,nginx-location,Nginx,Nginx Location,这是我第一次在Debian上使用nginx。 因此,我在/var/www/gis/index.html中有一个html页面 我将nginx配置为: server { listen 80; listen 443 ssl http2; listen [::]:443 ssl http2; server_name localhost; ssl_certificate /etc/ssl/certs/localhost.cr

这是我第一次在Debian上使用nginx。 因此,我在/var/www/gis/index.html中有一个html页面 我将nginx配置为:

server {
        listen 80;
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name localhost;

        ssl_certificate /etc/ssl/certs/localhost.crt;
        ssl_certificate_key /etc/ssl/private/localhost.key;

        ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

        location / {

        root /var/www/gis;
        index index.html;

        }
如果输入
https://localhost
在浏览器中。 但是如果我把位置标签改成

        location /gis {  ## or location = /gis ##)

        root /var/www/gis;
        index index.html;

        }

我希望在
https://localhost/gis/
,但出现错误404。我做错了什么?

使用此配置,nginx希望在
/var/www/gis/gis/
上找到您的
index.html
。你可以用任何一种

location /gis {
    root /var/www;
    index index.html;
}


的确多谢各位!
location /gis {
    alias /var/www/gis;
    index index.html;
}