开发者

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 = / {}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜