Let's say i have a virtual host in Nginx wtih name
www.domain.com and root directory named
public. Inside public i have 2 dirs
dir2. How i redirect the request to www.domain.com to
I know it's a simple question, but i am new to nginx.
Do you want to redirect visitors from www.domain.com to www.domain.com/dir1 ?
Then you can use a rewrite statement to rewrite. When you include http:// or https:// in the rewrite it will redirect visitors.
If you just want to use dir1 to serve content from, you can use alias, or you can rewrite without http:// like this: