I was following this DO article: https://www.digitalocean.com/community/tutorials/nginx-location-directive
And have these doubts regarding nginx conf files directives:
/t
and /s
and user types /f
, then which location would be served, and why?^~ /somepath
prefix, and the visitor has typed example.com/some
then would Nginx stop searching even at this partial match? If yes, then it’d stop at /
matching also? If so, then why that conf file should’ve any other location block at all? Because in any case, /
would be matched at all times, then why bother having any other locations?!!sub.example.com/somepath/?user=any
then what exactly is $host and what exactly is $hostname in it?This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey @bathindahelper,
Those are all good question. Let me try to clarify them. Having said that, If I’m unable to or it’s not clear enough, I’ll urge you to check the following Nginx documentation on location blocks:
https://docs.nginx.com/nginx/admin-guide/web-server/web-server/#location_priority
/t
and/s
and user types/f
, then which location would be served, and why?^~ /somepath
prefix, and the visitor has typedexample.com/some
then would Nginx stop searching even at this partial match? If yes, then it’d stop at/
matching also? If so, then why that conf file should’ve any other location block at all? Because in any case,/
would be matched at all times, then why bother having any other locations?!!/somepath
or/somepath/logo.png
will be matched but stops searching as soon as a match is found. So no, it will not work atsome
More on those here
https://www.digitalocean.com/community/tutorials/nginx-location-directive