Having trouble adding headers to specific path in NGINX
Trying to add a no index header to a specific path (/path) but it doesn't show up. When I add it in with the other add_header lines, it shows just fine but not when put into location /path {} or even location / {}.
If you include a specific header to a location, it will override all the headers as well. So you need to add all headers to that location as well. ou can do that using an include of a file with headers, as an example
Thanks, @bobbybouwmann, appreciate your help on this. You're right, the try_files in location / & /path passes processing on to the PHP location block, which means no headers are added. What I ended up doing that worked instead of including an external file was added the add_header X-Robots-Tag to the server block with the others and then used a map to control its value based on the $request_uri. Hope that helps someone else that might come across this.