docker icon indicating copy to clipboard operation
docker copied to clipboard

X-Robots-Tag error

Open ptoulouse opened this issue 5 years ago • 1 comments

Nextcloud 19.0.1

I am running behind Traefik and I get an error message on the Admin Overview page stating that the X-Robot-Tags header is not set to "none". The problem is that Nextcloud seems to check that the header is set to "none" only and nothing else.

Snippet of my Traefik dynamic rules (yaml):

http:
    middlewares:
        secure-headers:
           headers:
              customResponseHeaders:
                 X-Robots-Tags: "none, noarchive, nosnippet, notranslate, noimageindex"

This cause the error.

Changing X-Robots-Tags to X-Robots-Tags: "none" makes the error disappear.

ptoulouse avatar Aug 27 '20 17:08 ptoulouse

Fortunately it is just a warning. Bear in mind that X-Robots-Tags: "none, noarchive, nosnippet, notranslate, noimageindex" is arguably doing more than X-Robots-Tags: "none".

FYI: I have resolved this using a custom traefik middleware setting this header differently for Nextcloud:

      traefik.http.routers.nextcloud-rtr.middlewares: "nextcloud-redirectregex@docker, nextcloud-wellknown@docker, nextcloud-header@docker"

      traefik.http.middlewares.nextcloud-redirectregex.replacepathregex.regex: '^/.well-known/ca(l|rd)dav'
      traefik.http.middlewares.nextcloud-redirectregex.replacepathregex.replacement: '/remote.php/dav/'
      traefik.http.middlewares.nextcloud-wellknown.replacepathregex.regex: '^(/.well-known.*)'
      traefik.http.middlewares.nextcloud-wellknown.replacepathregex.replacement: '/index.php$${1}"'
      traefik.http.middlewares.nextcloud-header.headers.frameDeny: 'false'
      traefik.http.middlewares.nextcloud-header.headers.customFrameOptionsValue: 'sameorigin'
      traefik.http.middlewares.nextcloud-header.headers.customResponseHeaders.X-Robots-Tag: 'none'

DennisGaida avatar Mar 02 '22 21:03 DennisGaida

It should be actually set to noindex, nofollow, which equals to none for Google but is also respected by Bing and other search engines (which do not understand none). Changed in recent Nextcloud already. All the other header values you added are obsolete if noindex is set. So they are not "doing more" but should be removed to save the additional bytes transferred and to avoid possible confusion of other search engines which do not understand them.

MichaIng avatar Mar 24 '23 14:03 MichaIng

Closing this in favour of https://github.com/nextcloud/server/issues/37409, since the warning is produced by the server, not by the Docker container setup.

MichaIng avatar Mar 26 '23 16:03 MichaIng