Reverse Proxy bad links

Created on 29 July 2025, 6 days ago

Wrong links in some languages

We have a multi language (37 languages) website and in some / random languages are some links wrong.

An example: On page with url https://www.interelectronix.com/cn - chinese language - the link to the imprint page points to the url https://www.interelectronix.com/imprint.html, which is the english version.

Environment

  • drupal 11.2.x
  • debian 12 with php 8.3
  • Cloudflare proxy

The reverse_proxy settings in settings.php are:

$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = [
  // IPv4
  '173.245.48.0/20',
  '103.21.244.0/22',
  '103.22.200.0/22',
  '103.31.4.0/22',
  '141.101.64.0/18',
  '108.162.192.0/18',
  '190.93.240.0/20',
  '188.114.96.0/20',
  '197.234.240.0/22',
  '198.41.128.0/17',
  '162.158.0.0/15',
  '104.16.0.0/13',
  '104.24.0.0/14',
  '172.64.0.0/13',
  '131.0.72.0/22',
  // IPv6
  '2400:cb00::/32',
  '2606:4700::/32',
  '2803:f800::/32',
  '2405:b500::/32',
  '2405:8100::/32',
  '2a06:98c0::/29',
  '2c0f:f248::/32',
];
$settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT |\Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED;

The link mentioned above is defined in a translatable block like this:
<p class="impressum-link"><a href="internal:node/645" title="Imprint">

Hints

In our staging enviroment - without the Cloudflare Reverse Proxy - the problem do not exist

Are there any suggestions to handle this problem?

🐛 Bug report
Status

Active

Version

11.2 🔥

Component

cache system

Created by

🇩🇪Germany walterp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @walterp
  • Let us know how to reproduce this bug. Can you determine the precise conditions under which it occurs?

  • 🇩🇪Germany walterp

    Unfortunately there are no precise and reproducible conditions. The procedure is:

    • rollout code, mysql and files from staging website to production website
    • flush cache on production website
    • flush cache on Cloudflare

    And then randomly links - especially in blocks in the footer - show this behavior.

    Sometimes, there are also pages shown in the wrong language (e.g. language path points to .../pl/... and chars on the page are in chinese font/language).
    It's hard to find pages with mistakes.

    If we flush only the Cloudflare cache of the page with the wrong links or the false font, the links are OK and/or the font/language is OK.

  • 🇨🇦Canada danrod Ottawa
  • 🇩🇪Germany walterp

    Just a theory of mine for discussion:

    In drupal settings Language -> Detection and selection -> Content language detection we have the following settings in this series:

    • URL
    • User
    • Browser
    • Content language

    In english, we have no language prefix, while all other languages have a prefix (.../de/..., .../cn/..., and so on).

    Is it possible, that a visitor comes to our website to an english page - without prefix - and and have in his browser settings chinese as language, that then chinese language is shown and cached?

    Should we set only 'URL' detection?

  • What are the HTTP cache headers emitted by the site to Cloudflare on affected pages? That should answer your question.

Production build 0.71.5 2024