Nginx domain path issue
Solution 1:
You need to externally redirect /
to /parks/fairgrounds/
in the second server
block.
Try:
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name example.com;
...
location = / {
return 301 /parks/fairgrounds/;
}
location / {
...
}
}
The first location
block only matches /
and externally redirects visitors to https://example.com/parks/fairgrounds/
. The second location
block is your existing location block, and handles everything else. See this document for details.