I am running an nginx reverse proxy in docker to share my apps (some docker, some jails, some standalone/VMs) out over 443.
Port conflicts on docker are easily handled in the docker run command (or in the Rancher Port settings for the service), you just pick a new non-conflicting port to use on the host and map the container internal port (can be 80 on every container if the app wants it) and map it to the selected port on the host. Optionally, you don’t even need to do that if you link the nginx container to the other containers and it can access the container by name and use the original port number without needing to publish it to the host at all.
I’m not really too keen to just write down everything I’ve done, but I will give you pointers to helpful resources and give tips on what to look at or how to get to the next stage as you go.
First is to install a container for nginx with 80 and/or 443 published and then port-forward 80 and/or 443 on your router to that container host.
Then you need to work on having an nginx config file that suits what you need (which will depend heavily on how you want to proceed.
I have been pulling my hair out trying to get this working.
Are you able to give me a working example of a reverse proxy please?
I've deleted all info in the "default"file (/etc/nginx/sites-available/default) and that is where i am trying to set it up.
This is an example of what I've been trying.
Code:
server { listen 80; server_name organizr.local; location / { proxy_set_header Host $host; proxy_pass http://192.168.1.99:80/; proxy_set_header X-Real-IP $remote_addr; } }
I'm trying to re-route the ip address of organizr which uses port 80 to use organizr.local.
I'm likely going about this all wrong.
This is my setup
Rancher with portainer - 192.168.1.99:9000
Containers i will/want to use:
Emby (8096)
Jackett (9117)
Organizr (80)
Plex (32400, 3005, 8324, 32469, 1900, 32410, 32412, 32413, 32414)
Radarr (7878)
Sonarr (8989)
Tautulli (8181)
Transmission (9091)
Pi-Hole (53, 67, 80, 443)
Ombi (3579)
At the moment i am testing nginx on a ubuntu server (192.168.1.98) until i can work out how to place my config for nginx in a docker container. As you can see, so far there is only 1 port conflict i think.