最初是 用户 --> http 1081 --> proxy_pass 14.xx.xx.xx:10810 现在需要改成: 用户 --> http 1081 --> https 1083 --> proxy_pass 14.xx.xx.xx:10810 (网闸地址)
原本nginx配置:
server{ listen 1081; index index.shtml index.php index.htm member.html index.html; location / { index index.php index.html; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Host $remote_addr; proxy_pass https://14.xx.xx.xx:10810; }}
根据需求改造后:
server{listen 1081;rewrite ^/(.*)$ https://$host:1083/$1 permanent;}server{ listen 1083; index index.shtml index.php index.htm member.html index.html; location / { index index.php index.html; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Host $remote_addr; proxy_pass https://14.xx.xx.xx:10810; }}
上图是联系华为云技术所配置的ELB操作,注意是要跳到8:1083和9:1083而不是,1081端口,否则会出现重定向过多!域名,SSL证书是配置在华为云上的。