mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-01 13:17:21 +02:00
Created Move to Zoraxy from Nginx Proxy Manager (markdown)
parent
010d59b5db
commit
2d5ead7735
108
Move-to-Zoraxy-from-Nginx-Proxy-Manager.md
Normal file
108
Move-to-Zoraxy-from-Nginx-Proxy-Manager.md
Normal file
@ -0,0 +1,108 @@
|
||||
Most people who selfhost different services use the Nginx Proxy Manager (NPM) for easy managing their services with or without Docker. I would like to show you how to move over to Zoraxy.
|
||||
|
||||
1. First make a list of your existing proxyhosts in NPM because you need to create them new in Zoraxy!
|
||||
|
||||
2. If you use portmappings for your containers like 8080:80, you can easily use the same in Zoraxy.
|
||||
|
||||
You only need to point your proxyhost to localhost:8080, exactly the same like in NPM. That´s it!
|
||||
|
||||
|
||||
3. If you have a separate docker network and use hostnames within NPM (for example paperless:80), you can not use them in Zoraxy, since Zoraxy is not part of the docker network. You can use one of the docker images linked in the readme to use Zoraxy in a container and use them anyway.
|
||||
|
||||
If you installed Zoraxy the provided way on your host, you can still use your existing docker network. The only thing to do is to use portmappings or give each docker service a static IP. This is needed since the IP of the container changes every time you do docker compose down and docker compose up -d
|
||||
|
||||
|
||||
So you want to create a seperate docker network then you can use this:
|
||||
|
||||
`docker network create --subnet=172.40.0.0/16 staticnet`
|
||||
|
||||
If it is successfull it will give you a long output like "2cabe0428cb514e3e3d8e49d358df0930f519b8a80a39886dd8c8cae4fd6cfa1", if it fails with "Error response from daemon: Pool overlaps with other one on this address space", then increase the number 40 to 41, 42 etc.. in the subnet parameter. Now we have a new network named "staticnet".
|
||||
|
||||
The next step is to integrate this network in the docker-compose.yml
|
||||
|
||||
`nano docker-compose.yml`
|
||||
|
||||
Take a look at this example:
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
app:
|
||||
image: app-image:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./files:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./database:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=postgres
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=changeme
|
||||
- POSTGRES_INITDB_ARGS= --encoding='UTF8' --lc-collate='C' --lc-ctype='C'
|
||||
```
|
||||
|
||||
|
||||
We can comment out the portmapping, since we use the container IP directly and only need the port inside the container. Then we add the container to our network "staticnet" and give it a unique IP. Please start with the IP 172.40.0.2, because the numbers 255, 0 and 1 are already used in the network.
|
||||
|
||||
An example file would now look like this:
|
||||
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
app:
|
||||
image: app-image:latest
|
||||
restart: unless-stopped
|
||||
# ports:
|
||||
# - "8080:80"
|
||||
networks:
|
||||
staticnet:
|
||||
ipv4_address: 172.40.0.2
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./files:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fSs", "http://localhost:8008/health"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./database:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=postgres
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=changeme
|
||||
- POSTGRES_INITDB_ARGS= --encoding='UTF8' --lc-collate='C' --lc-ctype='C'
|
||||
|
||||
networks:
|
||||
staticnet:
|
||||
external: true
|
||||
```
|
||||
|
||||
The last 3 lines tell docker compose to use our already created network.
|
||||
|
||||
With this easy change you can now point Zoraxy to CONTAINER_IP:PORT, in this example it would be 172.40.0.2:80. This is the only thing to do for the most services. Some services need a few more steps, like Synapse (Matrix). Take a look here [Troubleshoot](https://github.com/tobychui/zoraxy/wiki/Troubleshooting----Workarounds) for this.
|
||||
|
||||
Further information about docker networking can be found here: [Docker Network](https://docs.docker.com/engine/tutorials/networkingcontainers/)
|
||||
|
||||
I have tested these services with this method and it worked without any further configuration:
|
||||
|
||||
Kavita, Jellyfin, Immich, Paperless-ngx, Adguard, Dashdot, SearxNG, Nextcloud, Gotify, WikiJS, Vaultwarden and Stirling PDF
|
Loading…
x
Reference in New Issue
Block a user