planka
planka copied to clipboard
planka behind a nginx reverse proxy not working
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.
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?
I'm using apache for everything productive including reverse proxy stuff. But maybe Maks knows what to do here.
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
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
I still get the same error.
I just yesterday deployed planka behind traefik, works like a charm, happy to share config if wished.
I just yesterday deployed planka behind traefik, works like a charm, happy to share config if wished.
Please show the config. Thanks.
@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.
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...
reverse proxy to / on the domain is working fine.
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
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?
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.
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.
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?
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.
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?
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@[email protected]/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)
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
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";
Hi mzch ! You are very nice ! That was good ! I added these parameters as shown in my screenshot below
...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 ;)