我想使用nginx从HTTP更改为nodejs服务使用HTTPS,我已经创建了自签名证书
现在,我想从
http://xx.xx.xx.xxx:3000 至
https://xx.xx.xx.xxx:3000如何使用EC2实例、NGINX或ELB在亚马逊网络服务中实现这一点?
发布于 2018-09-05 18:06:12
中的server块上方
返回服务器{ listen 3000;if ( $http_x_forwarded_proto != 'https‘){
301 https://$host$request_uri;}}
重新启动nginx.
的
该请求将命中端口3000上的nginx,并将其重定向到端口443。
这是未经测试的,但适用于我在端口80和443的组合。
https://stackoverflow.com/questions/52165558
复制相似问题