How to setup haproxy with docker-compose and how to config so it will handle trattic to…
- User
How to setup haproxy with docker-compose and how to config so it will handle trattic to https://myserver.com and reverse proxy it to http://internal.com:8080?
- Assistant
To set up HAProxy with Docker Compose and configure it for handling traffic to https://myserver.com and reverse proxying it to http://internal.com:8080, you can follow these steps:
-
Create a new directory for your HAProxy configuration and navigate into it:
mkdir haproxy cd haproxy -
Create a
docker-compose.ymlfile in thehaproxydirectory and add the following content:version: '3' services: haproxy: image: haproxy:latest ports: - 80:80 - 443:443 volumes: - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
-