NGINX反向代理到https上游

时间:2020-10-21 21:55:45

标签: nginx nginx-reverse-proxy

尝试在启用了TSL的AWS Elastic Load Balancer之前设置Nginx反向代理。

我尝试过的配置:

events {}
http {
   upstream pricing {
       server pricing-api.my-awselb.com:443;
   }

   server {
       listen       80;
       server_name  localhost;

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

现在,当我尝试在端口8080上的本地docker中运行Nginx时,我得到404

> http http://localhost:8080/pricing
HTTP/1.1 404 Not Found
Connection: keep-alive
Content-Length: 0
Date: Wed, 21 Oct 2020 21:47:56 GMT
Server: nginx/1.19.3

上游本身可以从我的本地计算机访问:

> http https://pricing-api.my-awselb.com
HTTP/1.1 302 Found
Connection: keep-alive
Content-Length: 0
Date: Wed, 21 Oct 2020 21:54:36 GMT
Location: /swagger
Server: Kestrel

我的Nginx配置有什么问题?

0 个答案:

没有答案