docker-zulip: Nginx proxy problem "CSRF verification failed"

I use Zulip behind the nginx docker proxy image jwilder/nginx-proxy

2d9c16de8669 jwilder/nginx-proxy "/app/docker-entrypoi" 2 weeks ago Up 2 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp nginx

I configure using the option given in the doc.

    VIRTUAL_HOST: "team.comnmodel.org"
    VIRTUAL_PROTO: "https"
    VIRTUAL_PORT: "443"

Login page is accessible, but just after authentification i have this, whatever the login/password i test.

Forbidden (403)
CSRF verification failed. Request aborted.

So, i stop nginx-proxy, and rebuild image without VIRTUAL_* option

I use directly port 80:80, and 443:443 and the ip of my vps : https://51.255.47.40/

Error disapears, but i have now a problem to access LDAP, see https://github.com/Galexrt/docker-zulip/issues/62

So, there is some conflict between nginx-proxy and zulip image with self signed certificate?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 43

Most upvoted comments

I leave this as a note for me tomorrow (just in case I forget it 😄): @galexrt Check what headers are forwarded from jwilder’s nginx.

    proxy_set_header        X-Real_IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        X-NginX-Proxy   true;
    proxy_set_header        Host            $http_host;
    proxy_set_header        Upgrade         $http_upgrade;
    proxy_pass_header       Set-Cookie;
    proxy_pass              http://127.0.0.1:48668/znc/;

I Solved Problem with add

proxy_set_header Host $http_host;

in Nginx Proxy

@galexrt arg, continue tu see nothing with curl inside docker container :

➜  ~ sudo docker exec -it zulip_zulip_1 bash                                                              
root@6981c8724ea7:/# curl -k https://172.17.0.9 
root@6981c8724ea7:/#