我需要配置nginx,它充當我的站點(myportal.com)的反向代理。 nginx可以通過squid代理連接到實際的站點。如何配置nginx作爲站點的反向代理,這是魷魚代理的後臺
client - > nginx - > Squid Proxy - > web服務器。
備註:
a。客戶端假設nginx爲myportal.com的Web服務器。
b。 nginx通過squid代理從實際服務器(myportal.com)獲取內容。
謝謝塔倫。當目標Web服務器可直接訪問時,我們已成功將nginx配置爲反向代理。但是,連接到網絡服務於魷魚後面。我們正面臨着問題。因爲客戶端必須連接到nginx,假設它是目標服務器(因此沒有發送代理標頭)。 -
我們也嘗試了以下。
upstream @squid {
server localhost:3128;
}
server {
listen 80;
server_name relay.example.com;
location/{
proxy_pass http://@squid/$scheme://$host$uri;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Request-URI $request_uri;
proxy_redirect off;
}
}
向我們展示你已經嘗試了什麼配置,什麼問題你正面臨 –
編輯問題和更新的代碼,不要粘貼在這裏命令 –
@TarunLalwani ..任何建議? – user1819071