Docker Port Forwarding. Help Needed


I’m new to docker so I’m not sure if this is the right place for this topic.

I have a VPS that I’m using it as a webserver.
It’s running Ubuntu 16.04 x64
it has apache+nginx as reverse proxy.

I have installed docker containers and able to access them via


domain . com:port

instead of port numbers, I’m trying to access is via a subdirectory or a subdomain.

I have installed transmission docker for a test.

Normally, I’m able to access it via http:// ipaddress:9091/transmission/web/
or http:// domain . com:9091/transmission/web/

To get rid of port, I have added this rule in nginx.

location /torrent {

 proxy_pass http :// ipaddress:9091;


When I enter domain. com / torrent
it changes the adress into http:// domain .com/transmission/web/
but nothing is showing and it gives 404 not found error.

What am I missing ?
I really appreciate any help.


It would help to see your Dockerfile and docker-compose.yml file.
It would also help for you to describe the “flow”.

  1. URL to nginx
  2. What port is nginx listening on
  3. What port is apache listening on

The ports published for nginx and apache in your docker-compose.yml file are important in order to diagnose/help you.