我想設置nginx作爲一個反向rpoxy服務器在前面關閉使用基本身份驗證進行身份驗證的幾個IIS Web服務器。Nginx反向代理 - 通過基本認證
(注 - 這是不一樣的nginx providing the auth using a password file - 它應該只是被marshelling瀏覽器/服務器之間everythnig)
它的工作種類 - 不過通過每一個資源得到反覆提示輸入身份驗證(圖片/ CSS等)在一個頁面上。
upstream my_iis_server {
server 192.168.1.10;
}
server {
listen 1.1.1.1:80;
server_name www.example.com;
## send request back to my iis server ##
location/{
proxy_pass http://my_iis_server;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass_header Authorization;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
樓主確實放棄,而是試圖微軟的IIS應用程序請求路由(ARR)在處理Basic和NTML auth時沒有任何問題,但是導致了一些SharePoint 2013最小下載策略(MDS)中的一些非常奇怪的問題,我從來沒有做到這一點。 – Ryan 2013-11-01 12:19:34
也許這可能會有所幫助:http://serverfault.com/questions/230749/how-to-use-nginx-to-proxy-to-a-host-requiring-authentication – czerasz 2014-10-10 10:26:21
@matt你好,我需要通過像......用戶名:密碼,而不是領域=「等」這將仍然工作? – Jonathan 2016-08-22 22:14:29