Nginx Reverse Proxy into Foundry Containers #175
-
Hi There, I'm really struggling getting over the finish line setting up a reverse Nginx proxy server in front of two of your docker containers (eventually to be at /laz and /dom but for now just on different ports). Bit of a punt but can you offer any guidance? foundaryvtt-loc-image is built from felddy/foundryvtt-docker with the port changed to 8080. Nginx is running from the VM not docker. (but that didn't work either) docker-compose.yml version: "3.8"
services:
foundry:
image: foundaryvtt-loc-image (built from felddy/foundryvtt-docker with port change to 8080)
container_name: foundaryvtt-container
hostname: my_foundry_host
init: true
restart: "always"
volumes:
- type: bind
source: ../foundaryvtt-data/data
target: /data
environment:
- FOUNDRY_PASSWORD=<pass>
- FOUNDRY_USERNAME=<user>
- FOUNDRY_ADMIN_KEY=<key>
- CONTAINER_CACHE=/data/container_cache
- FOUNDRY_MINIFY_STATIC_FILES=true
ports:
- target: ${PORT:-8080}
published: ${PORT:-30001}
protocol: tcp
mode: host
foundry2:
image: foundaryvtt-loc-image
container_name: foundaryvtt-container2
hostname: my_foundry_host2
init: true
restart: "always"
volumes:
- type: bind
source: ../foundaryvtt-data3/data
target: /data
environment:
- FOUNDRY_ADMIN_KEY=<key2>
- FOUNDRY_PASSWORD=<pass2>
- FOUNDRY_USERNAME=<user2>
- CONTAINER_CACHE=/data/container_cache
- FOUNDRY_MINIFY_STATIC_FILES=true
ports:
- target: ${PORT:-8080}
published: ${PORT:-30000}
protocol: tcp
mode: host default.conf server {
listen 443 ssl;
server_name <my domain> www.<my domain>;
ssl_certificate /etc/letsencrypt/live/<my domain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<my domain>/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/<my domain>/chain.pem;
# location / {
# return 301 https://<my domain>/laz;
# }
location /laz {
proxy_pass http://127.0.0.1:30001;
}
location /dom {
proxy_pass http://127.0.0.1:30000;
}
}
server {
listen 80;
server_name <my domain> www. <my domain>;
return 301 https://<my domain>/$request_uri;
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @LousyLeonard, I'll see if I can help, but using a modification of the this project's container is going to limit my confidence in any solution I provide to you. You shouldn't need to change the port that is "exposed" by the container. If you want the service to listen on a different port, you simply need to "publish" that port. This might be a useful read if you are new to Docker networking: This is how I would accomplish what I believe you are trying to do using the container from this project. Let me know if it works for you.
|
Beta Was this translation helpful? Give feedback.
-
Following on from this if anyone is trying to do this. Within my server block I have had to add: client_max_body_size 2000M; To actually download some of the assets from foundry. |
Beta Was this translation helpful? Give feedback.
Hey @LousyLeonard,
I'll see if I can help, but using a modification of the this project's container is going to limit my confidence in any solution I provide to you. You shouldn't need to change the port that is "exposed" by the container. If you want the service to listen on a different port, you simply need to "publish" that port.
This might be a useful read if you are new to Docker networking:
This is how I would accomplish what I believe you are trying to do using the container from this project. Let me know if it works for you.
docker-compose.yml