R
R
Rag'n' Code Man2021-07-23 16:16:11
Nginx
Rag'n' Code Man, 2021-07-23 16:16:11

Why won't the admin panel open?

I have the following directory structure in the nginx/html folder:
$ admin_panel client

And the config is as follows (react application):

root html/client;

location / {
    try_files $uri $uri /index.html;
}

location = /CRMAccounts {
    proxy_pass http://localhost:4200/CRMAccounts;
}

location /CRM {
    proxy_set_header Host $host;
    proxy_pass http://localhost:4200/CRM;
}

location /auth {
    proxy_pass http://localhost:4200/auth;
}


I want /admin_panel to open the Admin Panel .
I have already tried everything, but nginx does not want to give me the admin panel page.

In general, I need this kind of logic:
When location = /admin_panel , root becomes ../admin_panel.

I tried to do it literally like this:
location = /admin_panel {
    root ../admin_panel;
}


But it didn't work.

Help...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-07-23
@ky0

Somewhat chaotically described. If the location needs a different root directory, just specify its absolute path.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question