Answer the question
In order to leave comments, you need to log in
How can I set an nginx location block other than "/" to avoid conflicts between independent operation of different services?
Can you please tell me how to disable the processing by the nginx server of the root uri location block - "/" ?
I have several services. I implemented them in separate repositories.
"Backend" service and "react-front" service.
Everything is implemented using docker (compose).
If I run services on ports :
ports: 808x:80 - services are available and handle fine.
If I define via expose : 80
then the "root" of the back, then the front is alternately opened, and bundle.js is not processed - it cannot find it.
I need to specify that front opens at the initial path "/front" , avoiding the processing of "/" .
I tried such implementation - https://docs.nginx.
location / {
try_files $uri $uri/ @front;
}
location @front {
add_header Content-Security-Policy ...;
root /var/www/front;
try_files $uri $uri/ /index.html$is_args$args;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question