Strapi /admin gives 404 errors after redirect Nginx

Viewed 299

After installing Strapi I only get error messages.

What have I done so far?

nginx.conf

# Strapi API and Admin
        location /api/ {
                rewrite ^/api/?(.*)$ /$1 break;
                proxy_pass http://127.0.0.1:1337;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host $http_host;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_pass_request_headers on;
        }

server.js

module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  url: env("PUBLIC_URL", "https://wp-admin.app/api"),
  app: {
    keys: env.array('APP_KEYS'),
  },
});

I am getting the following error messages:

The images and js not loading?

enter image description here

clicking the button to create an admin user a new page to /admin opens and gives the error in the console

enter image description here

Is there anyone who knows what the problem could be?

0 Answers
Related