location /product {
proxy_pass http://10.0.0.25:8080;
}
if I use my first location description for product folder, I should use http://mysdomain.com/product/
and I can not use http://mysdomain.com/product
from browser. I mean I should use a slash end of url. I want to access product folder with two stuation.
is there s difference between this:
location /product/ {
proxy_pass http://10.0.0.25:8080;
}
Best Answer
These locations are different. First one will match
/production
for example, that might be not what you expected. So I prefer to use locations with a trailing slash.Also, note that:
If you have something like:
and go to
http://example.com/product
, nginx will automatically redirect you tohttp://example.com/product/
.Even if you don't use one of these directives above, you could always do the redirect manually:
or, if you don't want redirect you could use: