Answer the question
In order to leave comments, you need to log in
NGINX proxying all pages except the home page?
Set up Nginx to proxy another site.
I want the proxied site to be displayed when visiting any page, but apart from the MAIN page, i.e. when a person enters the main page, an index file from the site folder was displayed.
What should be written in the location? Tried location = / {...}
it doesn't work.
Answer the question
In order to leave comments, you need to log in
nginx.org/ru/docs/http/ngx_http_index_module.html#index
Keep in mind that when using an index file, an internal redirection is made and the request may be processed in another location.
index index.html;
try_files is needed instead.location = / {
try_files /index.html =404;
}
location / {
proxy_pass ...;
}
location = / {
rewrite ^ /index.html break;
}
location / {
proxy_pass ...;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question