planka behind a nginx reverse proxy not working #88

Closed
opened 2026-02-04 17:06:07 +03:00 by OVERLORD · 23 comments
Owner

Originally created by @santosh on GitHub (Apr 3, 2021).

I am running the latest version of planka, straight from the master.

I have modified start script of client to serve it on port 3006. And here is part of my nginx configuration

location /planka/ {
    proxy_pass http://localhost:3006/;
}

This should serve the content on mydomain.com/planka. This does partially happens as I can see the index.html page being loaded at /planka/. But this is what I get in the console.

image


I have been in a similar situation with grafana, but luckily there is such a mechanism in grafana which allows hosting from sub path.

What are your views on this? Any workaround?

Originally created by @santosh on GitHub (Apr 3, 2021). I am running the latest version of planka, straight from the master. I have modified start script of client to serve it on port `3006`. And here is part of my nginx configuration ```conf location /planka/ { proxy_pass http://localhost:3006/; } ``` This should serve the content on `mydomain.com/planka`. This does partially happens as I can see the `index.html` page being loaded at `/planka/`. But this is what I get in the console. ![image](https://user-images.githubusercontent.com/1515991/113481396-ff1d4880-94b6-11eb-9fa1-069fe1da26a4.png) --- I have been in a similar situation with grafana, but luckily there is [such a mechanism](https://grafana.com/tutorials/run-grafana-behind-a-proxy/) in grafana which allows hosting from sub path. What are your views on this? Any workaround?
Author
Owner

@nickbe commented on GitHub (Apr 5, 2021):

I'm using apache for everything productive including reverse proxy stuff. But maybe Maks knows what to do here.

@nickbe commented on GitHub (Apr 5, 2021): I'm using apache for everything productive including reverse proxy stuff. But maybe Maks knows what to do here.
Author
Owner

@Zazama commented on GitHub (Apr 8, 2021):

This is my config, maybe it can help you.

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:3006;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

You also might have to append /planka/ to your BASE_URL setting

@Zazama commented on GitHub (Apr 8, 2021): This is my config, maybe it can help you. ``` location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://127.0.0.1:3006; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } ``` You also might have to append /planka/ to your BASE_URL setting
Author
Owner

@rubenmdh commented on GitHub (Apr 8, 2021):

I was struggling to get this to work, too. Finally got it working yesterday behind nginx.

This is my nginx related config:

location / {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;

                proxy_pass http://backend;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

Backend should be outside of the server tag: (I used eth0 IPv4 address, but I guess localhost or 127.0.0.1 should suffice)

upstream backend {
        ip_hash;
        server 192.168.4.23:3000;
}

Also make sure to configure the docker-compose.yml accordingly. I had to configure the BASE_URL to the exact url that was configured in nginx.
eg: BASE_URL=https://planka.example.com

@rubenmdh commented on GitHub (Apr 8, 2021): I was struggling to get this to work, too. Finally got it working yesterday behind nginx. This is my nginx related config: ``` location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } ``` Backend should be outside of the server tag: (I used eth0 IPv4 address, but I guess localhost or 127.0.0.1 should suffice) ``` upstream backend { ip_hash; server 192.168.4.23:3000; } ``` Also make sure to configure the docker-compose.yml accordingly. I had to configure the BASE_URL to the exact url that was configured in nginx. _eg: BASE_URL=https://planka.example.com_
Author
Owner

@santosh commented on GitHub (Apr 11, 2021):

I still get the same error.

@santosh commented on GitHub (Apr 11, 2021): I still get the same error.
Author
Owner

@mortbauer commented on GitHub (May 1, 2021):

I just yesterday deployed planka behind traefik, works like a charm, happy to share config if wished.

@mortbauer commented on GitHub (May 1, 2021): I just yesterday deployed planka behind traefik, works like a charm, happy to share config if wished.
Author
Owner

@zhangrr commented on GitHub (May 11, 2021):

I just yesterday deployed planka behind traefik, works like a charm, happy to share config if wished.

Please show the config. Thanks.

@zhangrr commented on GitHub (May 11, 2021): > I just yesterday deployed planka behind traefik, works like a charm, happy to share config if wished. Please show the config. Thanks.
Author
Owner

@mortbauer commented on GitHub (May 14, 2021):

@zhangrr I created a gist with the contents of my ansible role for planka, the traefik specific labels are araound line 88. Hope it helps.

@mortbauer commented on GitHub (May 14, 2021): @zhangrr I created a [gist](https://gist.github.com/mortbauer/833c7af8a0a276fc569ba199ea10fe98) with the contents of my ansible role for planka, the traefik specific labels are araound [line 88](https://gist.github.com/mortbauer/833c7af8a0a276fc569ba199ea10fe98#file-main-yaml-L88). Hope it helps.
Author
Owner

@janwels89 commented on GitHub (Sep 9, 2021):

Seems like its only possible to reverse proxy planka to the root of a domain.
I could not get a reverse proxy to https:'domain_here'/planka/ working...
there is static/.... stuff missing...

image

reverse proxy to / on the domain is working fine.

@janwels89 commented on GitHub (Sep 9, 2021): Seems like its only possible to reverse proxy planka to the root of a domain. I could not get a reverse proxy to https:'domain_here'/planka/ working... there is static/.... stuff missing... ![image](https://user-images.githubusercontent.com/57909534/132676678-5ce064ac-af74-4815-9f8c-042bcf18a5c7.png) reverse proxy to / on the domain is working fine.
Author
Owner

@Stadtschreck commented on GitHub (Oct 16, 2021):

I have a similiar problem, i use ngnix proxy manager,
if i set the baseurl to the local ip4, it work (over the ip)
if i set the url from nginx as baseurl, i stuck at the loading screen

@Stadtschreck commented on GitHub (Oct 16, 2021): I have a similiar problem, i use ngnix proxy manager, if i set the baseurl to the local ip4, it work (over the ip) if i set the url from nginx as baseurl, i stuck at the loading screen
Author
Owner

@soundneedle commented on GitHub (Jan 10, 2022):

Think I'm having the same issue. I'm using Synology reverse proxy, eg. https://planka.domain.com. If BASE_URL is set to same I can access planka externally, however it fails internally at its docker address 192xxxx:xxxx. If I set BASE_URL to the internal address 192.xxxx:3000, I can access it there but not at planka.domain.com.

I've setup many other docker containers w/reverse proxy and don't have this issue. Should this work or is there a config needed?

@soundneedle commented on GitHub (Jan 10, 2022): Think I'm having the same issue. I'm using Synology reverse proxy, eg. https://planka.domain.com. If BASE_URL is set to same I can access planka externally, however it fails internally at its docker address 192xxxx:xxxx. If I set BASE_URL to the internal address 192.xxxx:3000, I can access it there but not at planka.domain.com. I've setup many other docker containers w/reverse proxy and don't have this issue. Should this work or is there a config needed?
Author
Owner

@Rykimaruh commented on GitHub (Jan 21, 2022):

I am also having this issue. I placed it behind the Nginx server (non-docker version) and when it loads the page remotely, it's stuck loading. However, when I try it using localhost:3000, it loads up the sign-in page without issue.

@Rykimaruh commented on GitHub (Jan 21, 2022): I am also having this issue. I placed it behind the Nginx server (non-docker version) and when it loads the page remotely, it's stuck loading. However, when I try it using localhost:3000, it loads up the sign-in page without issue.
Author
Owner

@jitka commented on GitHub (Mar 23, 2022):

I have same issue (could not access static files after setting proxy to domain.com/planka) I would like to see "official" nginx setup example.

@jitka commented on GitHub (Mar 23, 2022): I have same issue (could not access static files after setting proxy to domain.com/planka) I would like to see "official" nginx setup example.
Author
Owner

@ontheair81 commented on GitHub (Mar 23, 2022):

For me it works without problem and without any custom configuration. Using this dockerized nginx reverse proxy for all of my services.

could not access static files after setting proxy to domain.com/planka

Never used that, maybe you can try to use a regular subdomain (planka.domain.com) instead?

@ontheair81 commented on GitHub (Mar 23, 2022): For me it works without problem and without any custom configuration. Using [this dockerized nginx reverse proxy](https://hub.docker.com/r/nginxproxy/nginx-proxy) for all of my services. > could not access static files after setting proxy to domain.com/planka Never used that, maybe you can try to use a regular subdomain (planka.domain.com) instead?
Author
Owner

@Alumniminium commented on GitHub (Apr 10, 2022):

location / {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
		proxy_pass         http://127.0.0.1:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
	}
location /socket.io/ {
		proxy_set_header   X-Real-IP $remote_addr;
		proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass         http://127.0.0.1:1337;
	        proxy_http_version 1.1;
	        proxy_set_header   Upgrade $http_upgrade;
		proxy_set_header   Connection "upgrade";
	}

I had to add a route for the websocket connection to fix the infinite loading.

@Alumniminium commented on GitHub (Apr 10, 2022): ``` location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /socket.io/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:1337; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } ``` I had to add a route for the websocket connection to fix the infinite loading.
Author
Owner

@djchoyr commented on GitHub (Jun 20, 2022):

location / {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
		proxy_pass         http://127.0.0.1:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
	}
location /socket.io/ {
		proxy_set_header   X-Real-IP $remote_addr;
		proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass         http://127.0.0.1:1337;
	        proxy_http_version 1.1;
	        proxy_set_header   Upgrade $http_upgrade;
		proxy_set_header   Connection "upgrade";
	}

I had to add a route for the websocket connection to fix the infinite loading.

I'm using a synology NAS but I don't know where the problem is. I have created other proxies for other docker services without any problem. Could you add the docker-compose code?

@djchoyr commented on GitHub (Jun 20, 2022): > ``` > location / { > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header Host $host; > proxy_pass http://127.0.0.1:3000; > proxy_http_version 1.1; > proxy_set_header Upgrade $http_upgrade; > proxy_set_header Connection "upgrade"; > } > location /socket.io/ { > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_pass http://127.0.0.1:1337; > proxy_http_version 1.1; > proxy_set_header Upgrade $http_upgrade; > proxy_set_header Connection "upgrade"; > } > ``` > > > > > > I had to add a route for the websocket connection to fix the infinite loading. I'm using a synology NAS but I don't know where the problem is. I have created other proxies for other docker services without any problem. Could you add the docker-compose code?
Author
Owner

@tikok974 commented on GitHub (Nov 24, 2022):

Hi everybody,

I installed Planka about 2 weeks ago to test it via Docker on my Synology NAS. I tried to set up a reverse proxy to use HTTPS instead of HTTP but it doesn't work !

In HTTPS I get to the login page and when I try to log in nothing happens after validating my credentials.
However, if I do it in HTTP ...it's ok :(

The proxy on my NAS captures HTTPS on port 3017 and redirects HTTP on port 3000 to the localhost (NAS is Docker host).
The Docker container has a port forwarding setting (port 3000 for the host to port 1337 for the container)

Here is my docker-compose if it can help to find what is wrong
`version: '3'

services:
planka:
container_name: my-planka
image: ghcr.io/plankanban/planka:latest
command: >
bash -c
"for i in seq 1 30; do
./start.sh &&
s=? && break || s=?;
echo "Tried $$i times. Waiting 5 seconds...";
sleep 5;
done; (exit $$s)"
restart: unless-stopped
volumes:
- user-avatars:/app/public/user-avatars
- project-background-images:/app/public/project-background-images
- attachments:/app/private/attachments
- /volume1/docker/planka/logs/:/app/logs/
ports:
- 3000:1337
networks:
netplanka:
ipv4_address: 192.168.12.4
environment:
- BASE_URL=https://myserver.mydomain:3017
- TRUST_PROXY=0
- DATABASE_URL=postgresql://postgres:xxxxxxxx@xxxxxxx@192.168.12.5/planka
- SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
depends_on:
- postgres

postgres:
container_name: my-plankapostgres
image: postgres:14-alpine
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_PASSWORD=XXXXXXXXXXX
networks:
netplanka:
ipv4_address: 192.168.12.5

networks:
netplanka:
name: netplanka
driver: bridge
ipam:
config:
- subnet: 192.168.12.0/27
gateway: 192.168.12.1

volumes:
user-avatars:
project-background-images:
attachments:
db-data:`

I attach the capture from my browser (developer mode)

Capture d’écran_2022-11-24_16-05-31

I tried to change BASE_URL to the address I use in my browser (https://myserver.mydomain:3000) but it doesn't work !
Many thanks

@tikok974 commented on GitHub (Nov 24, 2022): Hi everybody, I installed Planka about 2 weeks ago to test it via Docker on my Synology NAS. I tried to set up a reverse proxy to use HTTPS instead of HTTP but it doesn't work ! In HTTPS I get to the login page and when I try to log in nothing happens after validating my credentials. However, if I do it in HTTP ...it's ok :( The proxy on my NAS captures HTTPS on port 3017 and redirects HTTP on port 3000 to the localhost (NAS is Docker host). The Docker container has a port forwarding setting (port 3000 for the host to port 1337 for the container) Here is my docker-compose if it can help to find what is wrong `version: '3' services: planka: container_name: my-planka image: ghcr.io/plankanban/planka:latest command: > bash -c "for i in `seq 1 30`; do ./start.sh && s=$$? && break || s=$$?; echo \"Tried $$i times. Waiting 5 seconds...\"; sleep 5; done; (exit $$s)" restart: unless-stopped volumes: - user-avatars:/app/public/user-avatars - project-background-images:/app/public/project-background-images - attachments:/app/private/attachments - /volume1/docker/planka/logs/:/app/logs/ ports: - 3000:1337 networks: netplanka: ipv4_address: 192.168.12.4 environment: - BASE_URL=https://myserver.mydomain:3017 - TRUST_PROXY=0 - DATABASE_URL=postgresql://postgres:xxxxxxxx@xxxxxxx@192.168.12.5/planka - SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx depends_on: - postgres postgres: container_name: my-plankapostgres image: postgres:14-alpine restart: unless-stopped volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust - POSTGRES_PASSWORD=XXXXXXXXXXX networks: netplanka: ipv4_address: 192.168.12.5 networks: netplanka: name: netplanka driver: bridge ipam: config: - subnet: 192.168.12.0/27 gateway: 192.168.12.1 volumes: user-avatars: project-background-images: attachments: db-data:` I attach the capture from my browser (developer mode) [ ![Capture d’écran_2022-11-24_16-05-31](https://user-images.githubusercontent.com/20242955/203817848-44da440c-1fd7-483b-ba0d-42dc32bb813b.png) ](url) I tried to change BASE_URL to the address I use in my browser (https://myserver.mydomain:3000) but it doesn't work ! Many thanks
Author
Owner

@mzch commented on GitHub (Nov 24, 2022):

Do you add settings of websocket proxy to nginx?

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
@mzch commented on GitHub (Nov 24, 2022): Do you add settings of websocket proxy to nginx? ```nginx proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; ```
Author
Owner

@tikok974 commented on GitHub (Nov 25, 2022):

Hi mzch !
You are very nice !
That was good !
I added these parameters as shown in my screenshot below

Capture d’écran_2022-11-25_09-38-15
Capture d’écran_2022-11-25_08-51-00
Capture d’écran_2022-11-25_08-51-07
Capture d’écran_2022-11-25_08-51-41

...and put the real URL (the one i enter in my browser) in the BASE_URL variable of Planka and it works !
I hope it will also help other people ;)
Thanks a lot for your help ;)

@tikok974 commented on GitHub (Nov 25, 2022): Hi mzch ! You are very nice ! That was good ! I added these parameters as shown in my screenshot below ![Capture d’écran_2022-11-25_09-38-15](https://user-images.githubusercontent.com/20242955/203938131-ff74ff8a-8147-46ea-8485-a09ba178e6be.png) ![Capture d’écran_2022-11-25_08-51-00](https://user-images.githubusercontent.com/20242955/203933193-b91783c8-105d-46f0-b781-e95b85c08f27.png) ![Capture d’écran_2022-11-25_08-51-07](https://user-images.githubusercontent.com/20242955/203933225-b9a72d69-6950-41be-912a-37449fc9b5ae.png) ![Capture d’écran_2022-11-25_08-51-41](https://user-images.githubusercontent.com/20242955/203933511-d41dfed1-553d-4dfc-9f80-bd95d5faa976.png) ...and put the real URL (the one i enter in my browser) in the BASE_URL variable of Planka and it works ! I hope it will also help other people ;) Thanks a lot for your help ;)
Author
Owner

@nmincone commented on GitHub (May 28, 2024):

Maybe this will help with users on Linux/Docker NPM deployment. Here is the stack I used, .env variables can be changed.
Ensure base URL is set to "https". I didn't need to add any NPM advanced proxy settings for this to work with a wildcard cert...

`version: '3'

services:
planka:
image: ghcr.io/plankanban/planka:latest
restart: unless-stopped
volumes:
- /home/docker/planka/user-avatars:/app/public/user-avatars
- /home/docker/planka/project-background-images:/app/public/project-background-images
- /home/docker/planka/attachments:/app/private/attachments
ports:
- 3333:1337 # change to suit
environment:
- BASE_URL=https://planka.domain.com #change to suit
- DATABASE_URL=postgresql://postgres@postgres/planka
- SECRET_KEY=${SECRET_KEY}
- TRUST_PROXY=1
# - TOKEN_EXPIRES_IN=365 # In days

  # related: https://github.com/knex/knex/issues/2354
  # As knex does not pass query parameters from the connection string we
  # have to use environment variables in order to pass the desired values, e.g.
  # - PGSSLMODE=<value>

  # Configure knex to accept SSL certificates
  - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=true

  - DEFAULT_ADMIN_EMAIL=${DEFAULT_ADMIN_EMAIL} # Do not remove if you want to prevent this user from being edited/deleted
  - DEFAULT_ADMIN_PASSWORD=${DEFAULT_ADMIN_PASSWORD}
  - DEFAULT_ADMIN_NAME=${DEFAULT_ADMIN_NAME}
  - DEFAULT_ADMIN_USERNAME=${DEFAULT_ADMIN_USERNAME}

  # - OIDC_ISSUER=
  # - OIDC_CLIENT_ID=
  # - OIDC_CLIENT_SECRET=
  # - OIDC_SCOPES=openid email profile
  # - OIDC_ADMIN_ROLES=admin
  # - OIDC_EMAIL_ATTRIBUTE=email
  # - OIDC_NAME_ATTRIBUTE=name
  # - OIDC_USERNAME_ATTRIBUTE=preferred_username
  # - OIDC_ROLES_ATTRIBUTE=groups
  # - OIDC_IGNORE_USERNAME=true
  # - OIDC_IGNORE_ROLES=true
  # - OIDC_ENFORCED=true

  # Email Notifications (https://nodemailer.com/smtp/)
  - SMTP_HOST=${SMTP_HOST}
  - SMTP_PORT=${SMTP_PORT}
  - SMTP_NAME=${SMTP_NAME}
  - SMTP_SECURE=${SMTP_SECURE}
  - SMTP_USER=${SMTP_USER}
  - SMTP_PASSWORD=${SMTP_PASSWORD}
  - SMTP_FROM=${SMTP_FROM}

  # - SLACK_BOT_TOKEN=
  # - SLACK_CHANNEL_ID=
depends_on:
  postgres:
    condition: service_healthy

postgres:
image: postgres:14-alpine
restart: unless-stopped
volumes:
- /home/docker/planka/db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
interval: 10s
timeout: 5s
retries: 5

volumes:
user-avatars:
project-background-images:
attachments:
db-data:`

@nmincone commented on GitHub (May 28, 2024): Maybe this will help with users on Linux/Docker NPM deployment. Here is the stack I used, .env variables can be changed. Ensure base URL is set to "https". I didn't need to add any NPM advanced proxy settings for this to work with a wildcard cert... `version: '3' services: planka: image: ghcr.io/plankanban/planka:latest restart: unless-stopped volumes: - /home/docker/planka/user-avatars:/app/public/user-avatars - /home/docker/planka/project-background-images:/app/public/project-background-images - /home/docker/planka/attachments:/app/private/attachments ports: - 3333:1337 # change to suit environment: - BASE_URL=https://planka.domain.com #change to suit - DATABASE_URL=postgresql://postgres@postgres/planka - SECRET_KEY=${SECRET_KEY} - TRUST_PROXY=1 # - TOKEN_EXPIRES_IN=365 # In days # related: https://github.com/knex/knex/issues/2354 # As knex does not pass query parameters from the connection string we # have to use environment variables in order to pass the desired values, e.g. # - PGSSLMODE=<value> # Configure knex to accept SSL certificates - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=true - DEFAULT_ADMIN_EMAIL=${DEFAULT_ADMIN_EMAIL} # Do not remove if you want to prevent this user from being edited/deleted - DEFAULT_ADMIN_PASSWORD=${DEFAULT_ADMIN_PASSWORD} - DEFAULT_ADMIN_NAME=${DEFAULT_ADMIN_NAME} - DEFAULT_ADMIN_USERNAME=${DEFAULT_ADMIN_USERNAME} # - OIDC_ISSUER= # - OIDC_CLIENT_ID= # - OIDC_CLIENT_SECRET= # - OIDC_SCOPES=openid email profile # - OIDC_ADMIN_ROLES=admin # - OIDC_EMAIL_ATTRIBUTE=email # - OIDC_NAME_ATTRIBUTE=name # - OIDC_USERNAME_ATTRIBUTE=preferred_username # - OIDC_ROLES_ATTRIBUTE=groups # - OIDC_IGNORE_USERNAME=true # - OIDC_IGNORE_ROLES=true # - OIDC_ENFORCED=true # Email Notifications (https://nodemailer.com/smtp/) - SMTP_HOST=${SMTP_HOST} - SMTP_PORT=${SMTP_PORT} - SMTP_NAME=${SMTP_NAME} - SMTP_SECURE=${SMTP_SECURE} - SMTP_USER=${SMTP_USER} - SMTP_PASSWORD=${SMTP_PASSWORD} - SMTP_FROM=${SMTP_FROM} # - SLACK_BOT_TOKEN= # - SLACK_CHANNEL_ID= depends_on: postgres: condition: service_healthy postgres: image: postgres:14-alpine restart: unless-stopped volumes: - /home/docker/planka/db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=planka - POSTGRES_HOST_AUTH_METHOD=trust healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d planka"] interval: 10s timeout: 5s retries: 5 volumes: user-avatars: project-background-images: attachments: db-data:`
Author
Owner

@romanlucas commented on GitHub (Oct 24, 2024):

I had a similar problem: trying to serve planka (runing in docker) only on a local network via nginx. What did the trick for me was two things:

In the docker-compose.yml:
- BASE_URL=http://myservername/planka # use the exact url i want users in local network to use in the browser
- CORS_ORIGIN=http://myservername # configure planka to allow requests from the nginx-server

In the nginx config:
server {
listen 80;
server_name yourservername;

# Planka configuration with CORS and WebSocket support
location /planka {
    proxy_pass http://127.0.0.1:5002;  # <--- use the port you set in your docker-compose.yml
    proxy_set_header Host $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-Proto $scheme;

    # Rewrites URLs to ensure correct handling of the /planka base path
    rewrite ^/planka/(.*)$ /$1 break;

    # Handle WebSocket connections for real-time updates
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    # CORS Headers
    add_header 'Access-Control-Allow-Origin' 'http://yourservername';
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With';

    # Options method for CORS preflight
    if ($request_method = OPTIONS) {
        add_header 'Access-Control-Allow-Origin' 'http://yourservername';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With';
        return 204;
    }
}

}

hope this might help anyone in the future.

@romanlucas commented on GitHub (Oct 24, 2024): I had a similar problem: trying to serve planka (runing in docker) only on a local network via nginx. What did the trick for me was two things: In the docker-compose.yml: - BASE_URL=http://myservername/planka # use the exact url i want users in local network to use in the browser - CORS_ORIGIN=http://myservername # configure planka to allow requests from the nginx-server In the nginx config: server { listen 80; server_name yourservername; # Planka configuration with CORS and WebSocket support location /planka { proxy_pass http://127.0.0.1:5002; # <--- use the port you set in your docker-compose.yml proxy_set_header Host $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-Proto $scheme; # Rewrites URLs to ensure correct handling of the /planka base path rewrite ^/planka/(.*)$ /$1 break; # Handle WebSocket connections for real-time updates proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # CORS Headers add_header 'Access-Control-Allow-Origin' 'http://yourservername'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With'; # Options method for CORS preflight if ($request_method = OPTIONS) { add_header 'Access-Control-Allow-Origin' 'http://yourservername'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With'; return 204; } } } hope this might help anyone in the future.
Author
Owner

@koin32 commented on GitHub (Jan 27, 2025):

Hello everyone, the infinite loading error has stopped, what should I do?
`location / {

proxy_pass http://ip_and_port;  # <--- use the port you set in your docker-compose.yml
proxy_set_header Host $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-Proto $scheme;

# Rewrites URLs to ensure correct handling of the /planka base path
rewrite ^/(.*)$ /$1 break;

# Handle WebSocket connections for real-time updates
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

# CORS Headers
add_header 'Access-Control-Allow-Origin' *;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With';

# Options method for CORS preflight
if ($request_method = OPTIONS) {
    add_header 'Access-Control-Allow-Origin' *;
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With';
    return 204;
}

    }

`

Image
@koin32 commented on GitHub (Jan 27, 2025): Hello everyone, the infinite loading error has stopped, what should I do? `location / { proxy_pass http://ip_and_port; # <--- use the port you set in your docker-compose.yml proxy_set_header Host $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-Proto $scheme; # Rewrites URLs to ensure correct handling of the /planka base path rewrite ^/(.*)$ /$1 break; # Handle WebSocket connections for real-time updates proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # CORS Headers add_header 'Access-Control-Allow-Origin' *; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With'; # Options method for CORS preflight if ($request_method = OPTIONS) { add_header 'Access-Control-Allow-Origin' *; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Origin, Content-Type, Accept, Authorization, X-Requested-With'; return 204; } } ` <img width="952" alt="Image" src="https://github.com/user-attachments/assets/1dde7d17-9e0f-4199-883d-576d37bb6aab" />
Author
Owner

@nmincone commented on GitHub (Jan 27, 2025):

I put Planka behind NGNPM and did not have to add any advanced routing settings.

@nmincone commented on GitHub (Jan 27, 2025): I put Planka behind NGNPM and did not have to add any advanced routing settings.
Author
Owner

@HelloMihai commented on GitHub (Apr 4, 2025):

[SOLUTION]

for anyone looking
in NGINX when creating the proxy host, simply check:

  • "Websockets support"

Image

@HelloMihai commented on GitHub (Apr 4, 2025): ### **[SOLUTION]** for anyone looking in NGINX when creating the proxy host, simply check: - [x] "Websockets support" ![Image](https://github.com/user-attachments/assets/c55eec8f-2c86-4524-a2c8-2637ba85a381)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#88