redirect - nginx - can't figure out location for / only -


i struggled lot how redirects , stuff when enter www.example.com or www.example.com/ couldn't. location / {} takes cases tried:

location ~ ^/?$ {} 

or

location ~ ^/$ {} 

and many others none worked www.example.com or www.example.com/.

please help... need match exact location when enter www.example.com or www.example.com/.

thanks!

have tried:

location = / {} 

Comments