简体   繁体   English

AWS 负载均衡器附加:80 到 url 上 http 到 https 301 重定向

[英]AWS Load Balancer appends :80 to url on http to https 301 redirect

When I go to my example application: https://example.com/r/123 it works as expected.当我 go 到我的示例应用程序时: https://example.com/r/123它按预期工作。

If I go to http://example.com/r/123 it seems the load balancer changes the url to https://example.com:80/r/123 . If I go to http://example.com/r/123 it seems the load balancer changes the url to https://example.com:80/r/123 .

This page results in a ERR_SSL_PROTOCOL_ERROR.此页面导致 ERR_SSL_PROTOCOL_ERROR。

Is it possible to make AWS not add the port( :80 ) in the redirect?是否可以让 AWS 不在重定向中添加端口( :80 )?

在此处输入图像描述

My problem was solved by changing the server IP to 0.0.0.0 instead of the default value of localhost in the nuxt server config.我的问题通过将服务器 IP 更改为0.0.0.0而不是 nuxt 服务器配置中localhost的默认值来解决。

// nuxt.config.js
server: {
    host: '0.0.0.0',
},

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Classic Load Balancer AWS 上将 HTTP 重定向到 HTTPS - Redirect HTTP to HTTPS on Classic Load Balancer AWS aws 负载均衡器 http 到 https 重定向不起作用 - aws load balancer http to https redirect not working HTTP重定向到带有Load Balancer的HTTPS AWS EC2 - HTTP redirect to HTTPS AWS EC2 with Load Balancer 是否有选项将 http 流量重定向到 aws.network 负载均衡器中的 https - Is there option to redirect http traffic to https in aws network load balancer AWS EC2将HTTP重定向到HTTPS槽式负载均衡器 - AWS EC2 redirect HTTP to HTTPS trough load balancer 使用tomcat服务器和aws负载均衡器将http请求重定向到https - Redirect http requests to https with tomcat server and aws load balancer AWS Application Load Balancer 将所有 www 和非 http 重定向到 https:// - AWS Application Load Balancer redirect all www and non http to https:// 如何在 aws 经典负载均衡器上重定向 http -> https? - How to redirect http -> https on aws classic load balancer? 使用 Application Load Balancer 将 http 重定向到 https - Redirect http to https using Application Load Balancer 在AWS Load Balancer中将HTTP请求路由到HTTPS - Route HTTP request to HTTPS in AWS Load Balancer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM