我需要配置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