Closed santiagopoli closed 7 years ago
@santiagopoli you could use reqirep
Can you provide an example of how to do it in the yml? Do I have to put it in the "OPTION" environment variable?
@santiagopoli
You can either use EXTRA_FRONTEND_SETTINGS_<PORT>
or EXTRA_SETTINGS
to set the reqrep
For example: -e "EXTRA_FRONTEND_SETTINGS_8080=reqrep ^([^\ :]*)\ /service1/(.*) \1\ /\2"
Hi,
I have a swarm cluster with a service (service1) listening on port 8080 and a dockercloud-haproxy listening on port 80.
I've added the VIRTUAL_HOST variable in the service1 configuration (VIRTUAL_HOST=*/service1).
The problem I'm facing is that the proxy is redirecting requests in the form of { examplehost/service1 -> examplehost:8080/service1 }, but I want to achieve something like { examplehost/service1 -> examplehost:8080 }
I assume this MUST be possible, because I think is the most common use case. For example I'm creating a service that uses the bargenson/docker-swarm-visualizer image, and I want to have access to it by doing something like http://myhost.com/visualizer rather than http://myhost.com:8080
The relevant part in the docker-compose.yml for this scenario is:
Thanks in advance!