opened 10:45AM - 07 Sep 24 UTC
issue: bug
severity: high
status: confirmed
version: 5
source: core:core
## Bug report
### Required System information
- Node.js version: v18
- St…rapi version: 5.0.0-rc.17
- Database: postgres
- Operating system: Linux
- Is your project Javascript or Typescript: Typescript
### Describe the bug
Installing Strapi in a Sub-Path on a Server (f.e. https://rooturl.tld/backend) seems nearly unpossible. In a fresh install with server config url: https://rooturl.tld/backend/ and admin config admin-url: /admin (at build-time and runtime) the admin page generally loads (http 200) in /backend/admin, but the resources are loaded from the root path (https://rooturl.tld/strapi-BA4UeQmR.js). This leads to 404 and a blank page.
### Steps to reproduce the behavior
1. Build Strapi with ENV URL=https:/rooturl.tld/backend/, ENV ADMIN_URL=/admin
2. Run Container
3. Admin Page is blank because js resources could not be loaded
### Expected behavior
The resources should not ignore server-paths.
### Code snippets
We are running strapi in a kubernetes cluster and have a rewrite in our virtual service:
```
- name: "backend-routes"
match:
- uri:
prefix: "/backend/"
rewrite:
uri: "/"
route:
- destination:
host: strapi-backend
port:
number: 1337
```
We already tried nearly all permutations in rewriting, ENV URL/ADMIN URL setting (like ADMIN_URL=/backend/admin) etc., but the initial javascript is always requested from the root url.