[GH-ISSUE #634] CSRF verification failed. Request aborted. #458

Closed
opened 2026-02-25 23:42:31 +03:00 by kerem · 4 comments
Owner

Originally created by @SrilakshmiDoma14 on GitHub (Apr 8, 2022).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/634

Hi,

I'm running healthchecks on a docker container. I installed docker and docker compose on an ec2 server and running the health checks as a service. I also added a dns url through nginx. On trying to login, I'm getting CSRF verification failed. Request aborted
Any help would be appreciated!!
Also where should I check the error logs.
Thanks in advance

Originally created by @SrilakshmiDoma14 on GitHub (Apr 8, 2022). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/634 Hi, I'm running healthchecks on a docker container. I installed docker and docker compose on an ec2 server and running the health checks as a service. I also added a dns url through nginx. On trying to login, I'm getting `CSRF verification failed. Request aborted` Any help would be appreciated!! Also where should I check the error logs. Thanks in advance
kerem closed this issue 2026-02-25 23:42:31 +03:00
Author
Owner

@SrilakshmiDoma14 commented on GitHub (Apr 8, 2022):

able to resolve the issue

<!-- gh-comment-id:1092841114 --> @SrilakshmiDoma14 commented on GitHub (Apr 8, 2022): able to resolve the issue
Author
Owner

@issmirnov commented on GitHub (Jun 28, 2022):

Can you explain how you resolved this?

Otherwise: https://xkcd.com/979/

<!-- gh-comment-id:1168922915 --> @issmirnov commented on GitHub (Jun 28, 2022): Can you explain how you resolved this? Otherwise: https://xkcd.com/979/
Author
Owner

@jonasjancarik commented on GitHub (Sep 20, 2022):

Can you explain how you resolved this?

So I don't know about OP, but in my case, the first thing I did was I set DEBUG to True to see more details of the errors.

I am serving Healthchecks on healthchecks.localhost:1111 and the service itself is listening on localhost:7832.

Mostly through trial and error, I got working with ALLOWED_HOSTS=healthchecks.localhost and this in my nginx config:

    server {
        listen 1111;

        server_name healthchecks.localhost;
        location / {
            proxy_pass  http://localhost:7832;
            proxy_set_header Host 'healthchecks.localhost:1111';
        }
    }
<!-- gh-comment-id:1252772839 --> @jonasjancarik commented on GitHub (Sep 20, 2022): > Can you explain how you resolved this? So I don't know about OP, but in my case, the first thing I did was I set `DEBUG` to `True` to see more details of the errors. I am serving Healthchecks on `healthchecks.localhost:1111` and the service itself is listening on `localhost:7832`. Mostly through trial and error, I got working with `ALLOWED_HOSTS=healthchecks.localhost` and this in my nginx config: ``` server { listen 1111; server_name healthchecks.localhost; location / { proxy_pass http://localhost:7832; proxy_set_header Host 'healthchecks.localhost:1111'; } } ```
Author
Owner

@m-ocean-it commented on GitHub (May 15, 2023):

Here's how my /location block looks like after I'd solved that issue:

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Ssl https;
        proxy_set_header X-Forwarded-Proto https;
        proxy_pass_header X-CSRFToken;
        proxy_pass http://100.88.104.117:9000;
    }

I bet some of those lines are redundant, but, well, it works and thanks for that.

<!-- gh-comment-id:1547676527 --> @m-ocean-it commented on GitHub (May 15, 2023): Here's how my `/location` block looks like after I'd solved that issue: ``` location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Ssl https; proxy_set_header X-Forwarded-Proto https; proxy_pass_header X-CSRFToken; proxy_pass http://100.88.104.117:9000; } ``` I bet some of those lines are redundant, but, well, it works and thanks for that.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#458
No description provided.