The Strapi Admin Panel is stuck on loading after logging in to the production environment

I am currently deploying Strapi on AWS EC2 with Ubuntu and Nginx.

Strapi Version: 4.25.3

My website is, for example, https://www.my-site.com, and the default root path for the front end is https://www.my-site.com/web.

Here is my server.ts for Strapi:

export default ({ env }) => ({
host: env(‘HOST’, ‘0.0.0.0’),
port: env.int(‘PORT’, 1337),
app: {
keys: env.array(‘APP_KEYS’),
},
webhooks: {
populateRelations: env.bool(‘WEBHOOKS_POPULATE_RELATIONS’, false),
},
proxy: true,
url: env(‘ADMIN_PANEL_URL’, ‘’)
});
And here is my Nginx configuration:

location / {
proxy_pass http://127.0.0.1:1337;
}
location /api {
proxy_pass http://127.0.0.1:1337;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
location /web {
alias /var/www/html/web;
try_files $uri $uri/ /web/index.html;
}
location /admin {
proxy_pass http://127.0.0.1:1337/admin;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
Although I can see the admin panel login screen at https://www.my-site.com/admin, it gets stuck on loading after I log in. When I open the Developer Tools (F12), I notice that the request to https://www.my-site.com/admin/admin responds with “JavaScript disabled. Please enable JavaScript in your browser and reload the page to proceed.”

I want to know what the problem is. Please help me. :sob:

This topic has been created from a Discord post (1277293707367809076) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Huh, I came to the server myself trying to solve a similar problem. And just now, by some miracle, I was able to get it all set up.

  1. you will need to set up a subdomain. I’m not sure if it’s even necessary.
  2. suffer and despair for a few days trying to configure Ngnix and middlewares.js

Possible problems also include incorrect permissions and incorrect location of files on the server itself -_-

well, in the case of the error about jacasrcipt, try a different browser first

You can find my solution 7 posts above. It is called “Endless loading after logging in to the admin area”

Thanks for your reply. I’ve looked over your config, but it’s still not working. I think the issue might be with the subdomain.

Thanks for your reply. I’ve looked over your config, but it’s still not working. I think the issue might be with the subdomain.

Thanks! I’m following the steps to set it up and see if it works.