Django admin site redirecting to wrong location

190 Views Asked by At

I have a Django app, being deployed to Amazon Lambda using zappa. The admin routes are registered under /api, and when deployed, they get further deployed to /int, so the admin site is available under /int/api/admin/.

However, this site is served from CloudFront, which takes requests to /api and proxies them to /int/api. When I hit /api/admin/ on CloudFront, it requests /int/api/admin/ from my Lambda instance, and that sends a redirect to /int/api/admin/login which fails.

How do I fix this?

0

There are 0 best solutions below