opened 08:03PM - 10 Nov 20 UTC
type: bug
severity: medium
status: confirmed
source: admin
meta: EE Customer
## Bug report
### Describe the bug
There is a hard coded `/admin/init` pa…th that doesn't use the proxy settings leading to a failure to connect under certain types of proxying.
https://github.com/strapi/strapi/blob/4add565de4ecbcb7d2a3abedbc1e9174baf09d18/packages/strapi-admin/admin/src/containers/App/index.js#L57-L60
### Steps to reproduce the behavior
Attempt to set a proxying config where Strapi doesn't serve the Admin panel is instead the proxy application tries to serve it from the Strapi root such as:
```
server {
# Listen HTTP
listen 80;
server_name strapi.guru;
# Static Root
location / {
root /var/www/html;
}
# Client 1
location /client-01/api/ {
rewrite ^/client-01/api/(.*)$ /$1 break;
proxy_pass http://client1;
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;
}
# This right here is a symlink of the build folder into the /var/www/html folder, assuming the request should be to
# http://strapi.guru/client-01/init and not http://strapi.guru/client-01/admin/init
location /client-01/ {
root /var/www/html;
}
}
```
See the following `server.js` file for example:
```js
module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
url: env('NGINX_URL', 'http://strapi.guru/client-01'),
admin: {
serveAdminPanel: false,
auth: {
secret: env('ADMIN_JWT_SECRET'),
},
},
});
```
### Expected behavior
Admin should be using the proxy settings and adjusting this request
### Screenshots



### System
- Node.js version: v14
- NPM version: v6
- Strapi version: 3.2.1
- Database: PostgreSQL
- Operating system: Ubuntu 18.04