# How to setup Taiga with Docker & Nginx Reverse proxy manager?

**URL:** <https://community.taiga.io/t/how-to-setup-taiga-with-docker-nginx-reverse-proxy-manager/1876>\
**Category:** Self hosted Taiga\
**Created:** [September 22, 2023, 12:59am UTC](https://community.taiga.io/t/how-to-setup-taiga-with-docker-nginx-reverse-proxy-manager/1876 "2023-09-22T00:59:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Khyretos](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/khyretos/32/1573_2.png) [@Khyretos](https://community.taiga.io/u/Khyretos)\
**Post date:** [September 22, 2023, 12:59am UTC](https://community.taiga.io/t/how-to-setup-taiga-with-docker-nginx-reverse-proxy-manager/1876/1 "2023-09-22T00:59:51Z")

</div>

Hey there,

I Followed the 30 min instructions and got it to work on my localhost.  
I setup my proxy so it rerouts it to the docker instance but for some reason i cannot make it work  
I dont understand what i need to configure.

this is the error i get:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/3/387ecbc8fffc3e7f36836b7e6f53086017445e17.jpeg)

these are the settings i use in the .env :

```auto
TAIGA_SCHEME=https # serve Taiga using "http" or "https" (secured) connection
TAIGA_DOMAIN=192.168.178.34:9000 # Taiga's base URL
SUBPATH="" # it'll be appended to the TAIGA_DOMAIN (use either "" or a "/subpath")
WEBSOCKETS_SCHEME=wss # events connection protocol (use either "ws" or "wss")

```

and this is my taiga.conf (the one in the taiga-gateway)

```auto
server {
    listen 80 default_server;
    server_name taiga.mycompany.com;

    client_max_body_size 100M;
    charset utf-8;

    # Frontend
    location / {
        proxy_pass http://taiga-front/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # API
    location /api/ {
        proxy_pass http://taiga-back:8000/api/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # Admin
    location /admin/ {
        proxy_pass http://taiga-back:8000/admin/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # Static
    location /static/ {
        alias /taiga/static/;
    }

    # Media
    location /_protected/ {
        internal;
        alias /taiga/media/;
        add_header Content-disposition "attachment";
    }

    # Unprotected section
    location /media/exports/ {
        alias /taiga/media/exports/;
        add_header Content-disposition "attachment";
    }

    location /media/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://taiga-protected:8003/;
        proxy_redirect off;
    }

      location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_pass http://192.168.178.34:9000;
      }
      
      # Events
      location /events {
        proxy_pass http://192.168.178.34:9000/events;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
      }
}

```

without wss and https i can directly access it with ([http://192.168.178.34:9000](http://192.168.178.34:9000)) so i know its working. its just that i am missing a important setting and i do not know what i need to do.

and the funny thing is penpot works perfectly and i only had to put the proxy in.

can someone please help?

---

<div class="post-metadata">

**Author:** ![david.barragan](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/david.barragan/32/293_2.png) [@david.barragan](https://community.taiga.io/u/david.barragan)\
**Post date:** [September 22, 2023, 11:00am UTC](https://community.taiga.io/t/how-to-setup-taiga-with-docker-nginx-reverse-proxy-manager/1876/2 "2023-09-22T11:00:58Z")

</div>

You cannot create 2 proxy passes for the same rule (there are two `location /` rules, so the first one is ignored).

Try deleting the last two blocks of your file.

```auto
location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_pass http://192.168.178.34:9000;
      }
      
      # Events
      location /events {
        proxy_pass http://192.168.178.34:9000/events;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
      }

```

If you only need to be able to access taiga through _[taiga.mycompany.com](http://taiga.mycompany.com)_, adding the `server_name` rule at the beginning should be enough.

Those two rules are useful (and sufficient) if, instead of overriding taiga-gateway’s nginx, you install another nginx on the machine. taiga-gateway is in charge of serving all taiga services through port 9000 and the new nginx on the machine would be in charge of serving everything that taiga-gateway exposes through port 80. Optionally, this nginx could also be in charge of serving over https (with ssl certs), etc.

---

<div class="post-metadata">

**Author:** ![Khyretos](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/khyretos/32/1573_2.png) [@Khyretos](https://community.taiga.io/u/Khyretos)\
**Post date:** [September 25, 2023, 12:39pm UTC](https://community.taiga.io/t/how-to-setup-taiga-with-docker-nginx-reverse-proxy-manager/1876/3 "2023-09-25T12:39:26Z")

</div>

Thank you for the explanation.

I was able to get it working on my domain (gspot.tk) but for some reason i have not been able to make it work on my subdomain (projects.gspot.tk).

even though i specifically have the domain set to ‘projects.gspot.tk’ it does not allow it to happen:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/7/75bab112c946a07618f1e0edcc58594234256a7b.jpeg)

thse are the errors that appear when i try to connect to projects.gspot.tk:

- WebSocket connection to ‘wss://192.168.178.34:9000/events’ failed:
- WebSocket error: [object Event]

my taiga.conf is now:

```auto
server {
    server_name projects.gspot.tk;
    listen 80 default_server;
    client_max_body_size 100M;
    charset utf-8;

    # Frontend
    location / {
        proxy_pass http://taiga-front/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # API
    location /api/ {
        proxy_pass http://taiga-back:8000/api/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # Admin
    location /admin/ {
        proxy_pass http://taiga-back:8000/admin/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # Static
    location /static/ {
        alias /taiga/static/;
    }

    # Media
    location /_protected/ {
        internal;
        alias /taiga/media/;
        add_header Content-disposition "attachment";
    }

    # Unprotected section
    location /media/exports/ {
        alias /taiga/media/exports/;
        add_header Content-disposition "attachment";
    }

    location /media/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://taiga-protected:8003/;
        proxy_redirect off;
    }
}

```

and this is part of my .env:

```auto
TAIGA_SCHEME=https # serve Taiga using "http" or "https" (secured) connection
TAIGA_DOMAIN=projects.gspot.tk # Taiga's base URL
SUBPATH="" # it'll be appended to the TAIGA_DOMAIN (use either "" or a "/subpath")
WEBSOCKETS_SCHEME=wss # events connection protocol (use either "ws" or "wss")

```

---

<div class="post-metadata">

**Author:** ![Khyretos](https://dub1.discourse-cdn.com/flex017/user_avatar/community.taiga.io/khyretos/32/1573_2.png) [@Khyretos](https://community.taiga.io/u/Khyretos)\
**Post date:** [September 25, 2023, 3:05pm UTC](https://community.taiga.io/t/how-to-setup-taiga-with-docker-nginx-reverse-proxy-manager/1876/4 "2023-09-25T15:05:19Z")

</div>

Never mind, it was always working, it seems that it cached the page or something because i was able to get to the page in incognito mode… my bad.

to end this here is my config and maybe it is usefull for other persons:

.env file:

```auto
TAIGA_SCHEME=https # serve Taiga using "http" or "https" (secured) connection
TAIGA_DOMAIN=projects.gspot.tk # Taiga's base URL
SUBPATH="" # it'll be appended to the TAIGA_DOMAIN (use either "" or a "/subpath")
WEBSOCKETS_SCHEME=wss # events connection protocol (use either "ws" or "wss")

```

taiga.conf (just add 1 line server\_name {YOUR\_SERVER\_DOMAIN} ):

```auto
server {
    server_name projects.gspot.tk;
    listen 80 default_server;
	
    client_max_body_size 100M;
    charset utf-8;

    # Frontend
    location / {
        proxy_pass http://taiga-front/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # API
    location /api/ {
        proxy_pass http://taiga-back:8000/api/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # Admin
    location /admin/ {
        proxy_pass http://taiga-back:8000/admin/;
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
    }

    # Static
    location /static/ {
        alias /taiga/static/;
    }

    # Media
    location /_protected/ {
        internal;
        alias /taiga/media/;
        add_header Content-disposition "attachment";
    }

    # Unprotected section
    location /media/exports/ {
        alias /taiga/media/exports/;
        add_header Content-disposition "attachment";
    }

    location /media/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://taiga-protected:8003/;
        proxy_redirect off;
    }

    # Events
    location /events {
        proxy_pass http://taiga-events:8888/events;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
    }
}

```

nginx redirect setup:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/7/715dd2fa8ae4230efcd38af9df38012052dbecf5.png)  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/taiga/original/2X/4/4d9355d317f6743dc24a720d10192c3eebff598b.png)

in the end i didnt have to do much i was just ignorant to the fact that i already had data cached or saved. so for people that are doing this, remember to clean data/cache or just try it in incognito mode.
