nginx well-known 访问404错误

Nginx 默认不能访问 点开头的目录,需要在配置文件中授权访问

 

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        root /usr/share/nginx/html;
        index index.html index.htm;
        
         location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }
        #添加这一段
        location ~ /.well-known {
            allow all;  
	 } 
	 #或者使用伪静态 ,txt文件放在站点根目录下面 
	 rewrite /.well-known/pki-validation/(.*)$ /$1 last; }
« 返回

分类目录

最新文章

2025-07-31 20:03:00
2025-07-31 20:01:00
2025-07-31 19:59:00

最热文章

文章搜索

Powered by WHMCompleteSolution