Search code examples
amazon-web-serviceshttp-redirecthttpsamazon-elb

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.

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.

Is it possible to make AWS not add the port(:80) in the redirect?

enter image description here


Solution

  • 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.

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