加了SSL之后总弹出要求登录对话框:

when I add Lets encrypt ssl for my website, it always prompts a dialog 

搜狗浏览器:

sougou explorer:


火狐浏览器:

Firefox:


看到火狐提示Restricted,想到NginxRestricted的配置

When firefox prompts “Restricted”, it occurs to me that there is a config in Nginx

SSHVPS,进入Nginx配置目录:

SSH to my VPS, enter conf directory of Nginx

cd /etc/nginx/conf.d

修改配置:

change conf:

vi wordpress_https.conf

删除所有的wp-admin这一段

delete all parts of wp-admin 

 

    location ^~ /wp-admin/ {
           auth_basic "Restricted";
           auth_basic_user_file /etc/nginx/htpasswd/wpadmin;
    
           location ~* \.(htaccess|htpasswd) {
                   deny all;
           }
    
           location ~ \.php(?:$|/) {
                   fastcgi_split_path_info ^(.+\.php)(/.+)$;
                   include fastcgi_params;
                   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                   fastcgi_param PATH_INFO $fastcgi_path_info;
                   fastcgi_param HTTPS on;
                   fastcgi_pass php-handler-https;
                   fastcgi_read_timeout 60s;
           }
    }


reference:https://www.vultr.com/docs/one-click-wordpress

参考:https://www.vultr.com/docs/one-click-wordpress



分类: 生活与思考

发表评论

电子邮件地址不会被公开。 必填项已用*标注