0
問題,我有一個Nginx的虛擬主機具有以下內容:授權(401)與Nginx的
server {
listen 80;
location /.well-known {
alias /usr/local/etc/letsencrypt-webroot/.well-known;
}
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/sub.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/sub.domain.com/privkey.pem;
ssl_dhparam /etc/nginx/ssl/dh.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
location/{
proxy_pass http://127.0.0.1:3000;
proxy_cookie_path/"/; secure; HttpOnly";
auth_basic "No no no!";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
我有一個問題,當URL是/.well-known/...
。我得到一個401,因爲它不斷要求憑證。
所以我的問題是:
爲什麼
/.well-known
用戶保護?不應該在SSL部分到達location /
之前處理它,這是需要驗證的部分嗎?我該如何解決這個問題?基本上我需要的一切要求代理需要認證,除了
/.well-known
。
我正在使用http。將'.well-known'塊移動到其他部分工作。 – yzT