1. The problem I’m having:
I have a webrtc application that needs 2 ports. one for my server and the other running peerjs. I want to redirect both of them to https. but only the one on top is working.
2. Error messages and/or full log output:
There are no error messages. Just my peerjs is insecure when i open it in my chrome.
3. Caddy version:
v2.9.1
4. How I installed and ran Caddy:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
sudo vim /etc/caddy/Caddyfile
my_domain {
reverse_proxy localhost:3000
reverse_proxy /peerjs* localhost:8080
}
sudo systemctl restart caddy
a. System environment:
The app is running inside a docker container. but caddy is not.
b. Command:
sudo systemctl restart caddy
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
c. Service/unit/compose file:
FROM node:22.4.0
WORKDIR /app
COPY . /app
RUN npm install
RUN npm install peer -g
# Install concurrently (if you are using it)
RUN npm install -g concurrently
EXPOSE 3000 3001
# Run both commands in parallel using concurrently
CMD ["concurrently", "\"npm run devStart\"", "\"peerjs --port 8080 --path /peerjs\""]
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.