How to fix admin panel login issues in Strapi v5 behind reverse proxies
Last updated: January 13, 2026
If you're experiencing login issues with the Strapi v5 admin panel in production environments, particularly when running behind reverse proxies like AWS Load Balancer or Nginx, this is a known issue that can be resolved with proper configuration.
Symptoms
You may encounter the following issues:
Admin panel login page loads correctly
Login credentials are accepted (authentication endpoints return successful responses)
UI remains stuck on the login page instead of redirecting to the dashboard
Issue only occurs in production mode (NODE_ENV=production)
Works correctly in development mode
Root Cause
This issue affects Strapi v5.24.0 and later versions and is related to session cookie handling and proxy header trust in production environments behind HTTPS reverse proxies.
Solution
To resolve this issue, add the following configuration to your config/server.ts file:
export default ({ env }) => ({
// ... other config
// Fix for admin login behind reverse proxy
proxy: { koa: true },
// ... rest of config
});Reverse Proxy Configuration
Ensure your reverse proxy is configured to pass the correct headers:
X-Forwarded-Proto: httpsX-Forwarded-Host: your-domain.comX-Forwarded-For: client-ip
Example Nginx Configuration
server {
listen 443 ssl;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:1337;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}Verification
After implementing these changes:
Restart your Strapi application
Clear your browser cache and cookies
Attempt to log in to the admin panel
Verify that you're successfully redirected to the dashboard after login
This configuration resolves the session cookie handling issues that prevent proper authentication flow in production environments behind reverse proxies.