有个关于关于 nginx https 的疑惑,下面贴一个 nginx 配置

307 天前
 EggplantLover
backserver 是后端服务,访问 https://abc.com.cn/backserver/xxx 流量应该会被 ssl 加密吧,可是 proxy_pass 里是 http 协议,到了这里就算是走 http 协议了吗,这样安全吗?大家都是怎么配置的
server {
listen 80;
listen 443 ssl;
server_name abc.com.cn;
ssl_certificate ssl_key/server.pem;
ssl_certificate_key ssl_key/server.key;

location / {
return 301 https://$host$request_uri;
}
location /backserver {
proxy_pass http://backserver;
proxy_set_header Host $Host;
proxy_set_header x-forwarded-for $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
add_header Cache-Control no-store;
add_header Pragma no-cache;
proxy_http_version 1.1;
proxy_set_header Connection "";
client_max_body_size 1024m;
proxy_read_timeout 7200s;
proxy_send_timeout 1800s;
proxy_connect_timeout 1800s;
}
}

upstream backserver {
sticky;
server 10.11.0.1:8080;
server 10.11.0.2:8080;
server 10.11.0.3:8080;
server 10.11.0.4:8080;
}
572 次点击
所在节点    问与答
5 条回复
virusdefender
307 天前
内部流量走 http 还好
LLaMA2
307 天前
proxy_pass 是 http ,可是这个 http 可以限制指定 IP 访问,可以是仅本机的访问,可以带用户名密码的访问,所以没得问题,想明白了没
EggplantLover
307 天前
@ye4tar #2 明白了,相当于关起门来自家办事,有没有加密意义不大了
EggplantLover
307 天前
@virusdefender #1 想了想也是
ysc3839
307 天前
nginx 到 backserver 的网络可信就没问题,比如说是在同一局域网内,或者是通过安全的 VPN 连接

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/955847

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX