Search code examples
amazon-web-servicesaws-api-gatewayamazon-vpc

How to solve status code 302 in API Gateway?


I have currently configured an API in API gateway. I had VPC links configured for it which reference to network load balancer on port TCP:80.

Due to some requirement changes, I have to change the port TLS:443. But now if I test the API, it is showing status code 302.

After making that change it is showing this error, while in other case the VPC link is already pointing to load balancer at TLS:443 port and it is working well.

Can anyone please help me with this?


Solution

  • A 302 status code is returned for a redirect request.

    If your application is attempting to redirect from port 80 to 443 then this is likely the cause of this return.

    You should update your API Gateway to point at HTTPS rather than HTTP to avoid the redirect.