location /robots.txt conflict / issue

Francis Daly francis at daoine.org
Thu Sep 29 21:23:04 UTC 2016


On Thu, Sep 29, 2016 at 01:09:47PM -0400, c0nw0nk wrote:

Hi there,

The docs are at http://nginx.org/r/location

In this case, you want "=".

> location /robots.txt {
> location ~* \.(txt|ini|xml|zip|rar)$ {

A request for /robots.txt will match the second location there.

> location /robots.txt {
> location ~* \.(txt|ini|xml|zip|rar)$ {

A request for /robots.txt will still match the second location there.

Change the first location to be

  location = /robots.txt

and it should all Just Work.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list