R
R
Rag'n' Code Man2021-06-24 22:47:32
Nginx
Rag'n' Code Man, 2021-06-24 22:47:32

How to make such a config?

If locationany other than /api/, then we return index.html, and if location = /api/then proxy_pass localhost:4200

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2021-06-24
@iDmitriyWinX

location / {
    rewrite ^ /index.html break;
}

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

K
ky0, 2021-06-24
@ky0

location /api {
proxy_pass
}

location / {
что там вам нужно
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question