nginx - can't figure out location for / only
I struggled a lot how to do some redirects and stuff ONLY when I enter www.example.com OR www.example.com/ but I couldn't. location / {} takes all cases so I tried:
location ~ ^/?$ {}
or
location ~ ^/$ {}
and many others but none worked for www.example.com or www.example.com/.
Please help... I n开发者_如何学编程eed to match that exact location which is only when you enter www.example.com or www.example.com/.
Thanks!
Have you tried:
location = / {}
精彩评论