# from gis project server { listen 80; listen [::]:80; server_name localhost; set $root '/usr/share/nginx/html'; root $root; location / { index index.html index.htm; try_files $uri $uri/ /gis/index.html; add_header Access-Control-Allow-Origin *; autoindex off; #开启nginx目录浏览功能 autoindex_exact_size off; #文件大小从KB开始显示 autoindex_localtime on; #显示文件修改时间为服务器本地时间 } location ~ /.well-known { allow all; autoindex on; autoindex_exact_size off; autoindex_localtime on; } #location ~ /\.ht { # deny all; #} }