Cloudflared, pgadmin and CSRF token

Hey! We’ve been trying to set up self-hosted Pgadmin4 over Argo Tunnel on Ubuntu with apache. I can get the application, but every time I get “The CSRF tokens do not match.” error from Pgadmin when I login. If I disable cloudflared and try with a direct connection - everything works.
Any ideas on how to solve this?

cloudflared config is pretty basic:
[email protected]:/etc/cloudflared# cat config.yml
hostname: pgadmin.example.com
url: http://localhost:80
logfile: /var/log/cloudflared.log

And pgadmin4 configured with default setting.
Although I have tried to disable ENHANCED_COOKIE_PROTECTION in Pgadmin configuration but it didn’t help.

Hmm, my hunch on this is the following, currently your config file is this:

hostname: pgadmin.example.com
url: http://localhost:80
logfile: /var/log/cloudflared.log

I would recommend adding the:

originServerName

The below developer doc shows what the config option does. I have had issues in the past similar to this and adding this parameter (with the correct Name added) made the issue go away.

Again, this is a loose suggestion that may not work.

https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/ingress#originServerName

If the above does not work, try other config options such as noTLSVerify

Let us know how you get on, send us more info if you still encounter the issue.

I would also recommend looking over DevTools in your browser when you’re logging in to see if any of the requests are being blocked. This may be a Firewall issue, do you see any blocks in the Cloudflare dashboard.

Unfortunately, that doesn’t work. The issue is with pgadmin, quite a common one.