如何解决如何在nlb TLS后面配置nginx反向代理
我在ecs容器中有一个詹金斯人,并且链接到nginx作为在ecs中另一个容器中的反向代理。 Nginx从NLB接收呼叫,并为jenkins做反向代理。 我通过HTTPS网址访问Jenkins,并收到HTTP 301,我的浏览器重定向到HTTP。
我该如何解决这个问题?
请求和响应:
Request URL: https://myjenkins.com/pluginManager
Request Method: GET
Status Code: 302 Found
Remote Address: 10.169.19.52:443
Referrer Policy: same-origin
Connection: keep-alive
Content-Length: 0
Date: Fri,30 Oct 2020 18:51:42 GMT
Location: http://myjenkins.com/pluginManager/
Server: nginx/1.19.3
X-Content-Type-Options: nosniff
AWS参考: https://aws.amazon.com/pt/blogs/compute/nginx-reverse-proxy-sidecar-container-on-amazon-ecs/
nginx.conf
events {
worker_connections 768;
}
http {
# Nginx will handle gzip compression of responses from the app server
gzip on;
gzip_proxied any;
gzip_types text/plain application/json;
gzip_min_length 1000;
server {
listen 80;
location / {
proxy_pass http://jenkins:8080;
proxy_redirect default;
proxy_http_version 1.1;
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_max_temp_file_size 0;
#this is the maximum upload size
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffering off;
proxy_request_buffering off; # Required for HTTP CLI commands
proxy_set_header Connection ""; # Clear for keepalive
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。