-
Notifications
You must be signed in to change notification settings - Fork 29
Configuration examples for deploying on sub‐paths
Axel Leroy edited this page Dec 20, 2023
·
2 revisions
Some users might want to deploy multiple applications in addition to Self Host Planning Poker on the same domain, but on different paths.
Say for example that you want to deploy Self Host Planning Poker and FreshRSS on https://example.tld/poker/
and https://example.tld/freshrss/
respectively. You'll need to instruct your reverse-proxy to redirect requests made to https://example.tld/poker/
to your Self Host Planning Poker container, while rewriting the request so that it matches the container's root (http://poker/
). Finally, you'll need to set the environment variable APP_ROOT
to /poker/
.
# docker-compose.yml
version: '3'
services:
poker:
image: axeleroy/self-host-planning-poker:latest
expose:
- 8000:8000
volumes:
- planning-poker-data:/data
environment:
- APP_ROOT=/poker/
- VIRTUAL_HOST=example.tld
- VIRTUAL_PORT=8000
- VIRTUAL_PATH=/poker/
- VIRTUAL_DEST=/
networks:
- nginx-net
volumes:
planning-poker-data: {}
networks:
nginx-net:
external: true
# docker-compose.yml
version: '3'
services:
nginx:
image: nginx:1-alpine
ports:
- 80:80
- 443:443
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
poker:
image: axeleroy/self-host-planning-poker:latest
expose:
- 8000:8000
volumes:
- planning-poker-data:/data
environment:
- APP_ROOT=/poker/
volumes:
planning-poker-data: {}
# /etc/nginx/conf.d/poker.conf
location /poker/ {
proxy_pass http://poker:8000/;
# cf. https://socket.io/docs/v4/reverse-proxy/#nginx
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# docker-compose.yml
version: '3'
services:
poker:
image: axeleroy/self-host-planning-poker:latest
expose:
- 8000:8000
volumes:
- planning-poker-data:/data
environment:
- APP_ROOT=/poker/
networks:
- caddy
labels:
caddy: example.tld
caddy.handle_path: /poker/*
caddy.handle_path.0_reverse_proxy: "{{upstreams 8000}}"
networks:
caddy:
external: true
# docker-compose.yml
version: '3'
services:
poker:
image: axeleroy/self-host-planning-poker:latest
expose:
- 8000:8000
volumes:
- planning-poker-data:/data
environment:
- APP_ROOT=/poker/
networks:
- caddy
networks:
caddy:
external: true
# Caddyfile
example.tld {
handle_path /poker/* {
reverse_proxy http://poker:8000
}
}
# docker-compose.yml
version: '3'
services:
poker:
image: axeleroy/self-host-planning-poker:latest
expose:
- 8000:8000
volumes:
- planning-poker-data:/data
environment:
- APP_ROOT=/poker/
networks:
- traefik-net
labels:
traefik.http.routers.planning-poker.rule: PathPrefix(`/poker`)
traefik.http.routers.planning-poker.middlewares: poker-stripprefix
traefik.http.middlewares.poker-stripprefix.stripprefix.prefixes: /poker
networks:
traefik-net:
external: true