Nginx代理使用另一个代理服务器传递给服务器

时间:2019-06-15 22:52:54

标签: nginx reverse-proxy

我的问题与nginx配置有关。假设我有一个可以使用代理服务器访问的后端ip_backend,就像我必须在对ip_backend进行卷曲之前必须设置https_proxy = proxy_server

现在有另一台服务器说ip_frontend。如果在环境变量中设置https_proxy = proxy_server,我可以在curl中访问ip_backend

假设我将ip_frontend用作ip_backend的反向代理,以便用户始终使用ip_frontend ..我必须在nginx中做些什么配置才能通过ip_backend代理通过ip_backend,但是使用proxy_server。.

ip_frontend和ip_backend都将使用ssl连接。

我尝试这样做,但无法解决..它给出了502 ..我在哪里在这里注入proxy_server?

server {
   listen 443;
   server_name ip_frontend;
   ssl_certificate CERT_PATH;
   ssl_certificate_key KEY_PATH;

   location / {
     proxy_pass https://ip_backend;
   }
}

0 个答案:

没有答案