Podman containers + nginx proxy #289

Closed
opened 2026-02-04 18:24:15 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @abn0mad on GitHub (Feb 23, 2023).

Hi there,

Having issues deploying planka as separate (rootless) podman containers, fronted by an nginx reverse proxy.

Steps:

podman run -it \ --volume /data/planka/user-avatars:/app/public/user-avatars:Z \ --volume /data/planka/project-background-images:/app/public/project-background-images:Z \ --volume /data/planka/attachments:/app/private/attachments:Z \ --env=BASE_URL=https://planka.example.com \ --env=TRUST_PROXY=0 \ --env=DATABASE_URL=postgresql://planka:examplepw@10.8.0.11:5432/planka \ --env=SECRET_KEY=examplekey \ --network examplenet \ --ip 10.8.0.10 \ --name planka \ ghcr.io/plankanban/planka:latest

podman run -it \ --volume /data/planka/db:/var/lib/postgresql/data:Z \ --env=POSTGRES_USER=planka \ --env=POSTGRES_PASSWORD=examplepw \ --env=POSTGRES_DB=planka \ --network examplenet \ --ip 10.8.0.11 \ --name planka-db \ docker.io/library/postgres:14-alpine

(adding or removing the TRUST env variable doesn't change anything; as planka won't be approaching the db through localhost, it didn't seem necessary).

All the example* values are different in the actual deployment attempt. Both containers start up fine, although the main planka container displays this message when started interactively:

debug: Detected Sails environment is "production", but NODE_ENV is undefined. debug: Automatically setting the NODE_ENV environment variable to "production". debug:

Proxy configuration:

`upstream planka {
server 10.8.0.10:1337;
keepalive 32;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name kb.nakarma.com;

access_log /var/log/nginx/planka-access.log;
error_log  /var/log/nginx/planka-error.log error;

# SSL Configuration - Replace the example kb.nakarma.com with your domain
ssl_certificate /etc/letsencrypt/live/planka.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/planka.example.com/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;

client_max_body_size 120M;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Expose-Headers Content-Length;
add_header Access-Control-Allow-Headers Range;

# Make sure to allow socket.io connections
location ~* \.io {
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    client_max_body_size 50M;
    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-Proto $scheme;
    proxy_set_header X-Frame-Options SAMEORIGIN;
    proxy_buffers 256 16k;
    proxy_buffer_size 16k;
    client_body_timeout 60;
    send_timeout 300;
    lingering_timeout 5;
    proxy_connect_timeout 1d;
    proxy_send_timeout 1d;
    proxy_read_timeout 1d;
    proxy_pass http://planka;
}

location / {
    client_max_body_size 50M;
    proxy_set_header Connection "";
    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-Proto $scheme;
    proxy_set_header X-Frame-Options SAMEORIGIN;
    proxy_buffers 256 16k;
    proxy_buffer_size 16k;
    proxy_read_timeout 600s;
    proxy_cache_revalidate on;
    proxy_cache_min_uses 2;
    proxy_cache_use_stale timeout;
    proxy_cache_lock on;
    proxy_http_version 1.1;
    proxy_pass http://planka;
}

}`

I've also tried:

`server {
server_name planka.example.com;

location / {
    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;

    #proxy_set_header X-Forwarded-For $remote_addr;
    #proxy_set_header Host $http_host;

    proxy_pass http://10.8.0.10:1337;
    proxy_buffering off;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/planka.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/planka.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
if ($host = planka.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name git.nakarma.com;
return 404; # managed by Certbot

}`

In either case the result is a blank page, albeit with a window title.

Console error:

Loading failed for the <script> with source “https://planka.example.com/static/js/main.5ea5d3b8.js”. planka.example.com:1:1

The nginx deployment is proxying a few other services such as Gitea and Woodpecker-CI successfully, so it is functional.

Any help would be much appreciated.

Originally created by @abn0mad on GitHub (Feb 23, 2023). Hi there, Having issues deploying planka as separate (rootless) podman containers, fronted by an nginx reverse proxy. Steps: ` podman run -it \ --volume /data/planka/user-avatars:/app/public/user-avatars:Z \ --volume /data/planka/project-background-images:/app/public/project-background-images:Z \ --volume /data/planka/attachments:/app/private/attachments:Z \ --env=BASE_URL=https://planka.example.com \ --env=TRUST_PROXY=0 \ --env=DATABASE_URL=postgresql://planka:examplepw@10.8.0.11:5432/planka \ --env=SECRET_KEY=examplekey \ --network examplenet \ --ip 10.8.0.10 \ --name planka \ ghcr.io/plankanban/planka:latest ` ` podman run -it \ --volume /data/planka/db:/var/lib/postgresql/data:Z \ --env=POSTGRES_USER=planka \ --env=POSTGRES_PASSWORD=examplepw \ --env=POSTGRES_DB=planka \ --network examplenet \ --ip 10.8.0.11 \ --name planka-db \ docker.io/library/postgres:14-alpine ` (adding or removing the TRUST env variable doesn't change anything; as planka won't be approaching the db through localhost, it didn't seem necessary). All the example* values are different in the actual deployment attempt. Both containers start up fine, although the main planka container displays this message when started interactively: `debug: Detected Sails environment is "production", but NODE_ENV is undefined. debug: Automatically setting the NODE_ENV environment variable to "production". debug:` Proxy configuration: `upstream planka { server 10.8.0.10:1337; keepalive 32; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name kb.nakarma.com; access_log /var/log/nginx/planka-access.log; error_log /var/log/nginx/planka-error.log error; # SSL Configuration - Replace the example kb.nakarma.com with your domain ssl_certificate /etc/letsencrypt/live/planka.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/planka.example.com/privkey.pem; ssl_session_cache shared:SSL:10m; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"; ssl_prefer_server_ciphers on; client_max_body_size 120M; add_header Access-Control-Allow-Origin *; add_header Access-Control-Max-Age 3600; add_header Access-Control-Expose-Headers Content-Length; add_header Access-Control-Allow-Headers Range; # Make sure to allow socket.io connections location ~* \.io { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; client_max_body_size 50M; 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-Proto $scheme; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_buffers 256 16k; proxy_buffer_size 16k; client_body_timeout 60; send_timeout 300; lingering_timeout 5; proxy_connect_timeout 1d; proxy_send_timeout 1d; proxy_read_timeout 1d; proxy_pass http://planka; } location / { client_max_body_size 50M; proxy_set_header Connection ""; 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-Proto $scheme; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_buffers 256 16k; proxy_buffer_size 16k; proxy_read_timeout 600s; proxy_cache_revalidate on; proxy_cache_min_uses 2; proxy_cache_use_stale timeout; proxy_cache_lock on; proxy_http_version 1.1; proxy_pass http://planka; } }` I've also tried: `server { server_name planka.example.com; location / { 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; #proxy_set_header X-Forwarded-For $remote_addr; #proxy_set_header Host $http_host; proxy_pass http://10.8.0.10:1337; proxy_buffering off; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/planka.example.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/planka.example.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = planka.example.com) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; server_name git.nakarma.com; return 404; # managed by Certbot }` In either case the result is a blank page, albeit with a window title. Console error: `Loading failed for the <script> with source “https://planka.example.com/static/js/main.5ea5d3b8.js”. planka.example.com:1:1` The nginx deployment is proxying a few other services such as Gitea and Woodpecker-CI successfully, so it is functional. Any help would be much appreciated.
Author
Owner

@abn0mad commented on GitHub (Feb 23, 2023):

Fixed it by modifying the proxy_pass parameters on the official nginx proxy template provided by Planka.

Sorry for the disturbance and thank you for making Planka, I look forward to start using it :)

@abn0mad commented on GitHub (Feb 23, 2023): Fixed it by modifying the proxy_pass parameters on the official nginx proxy template provided by Planka. Sorry for the disturbance and thank you for making Planka, I look forward to start using it :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#289