I have a running node server which listens on 3 different ports.
I have three different subdomains of a url pointing to port 80
of the server on which node is running/listening.
What I am trying to do is proxy pass a request from a sub-domain to its respective port using haproxy
.
My node server is dockerized with the ports exposed on the host. I can hit them individually using the server's IP address on their port so they seem to be running fine.
My haproxy
will also be running inside a docker container. I am completely new to haproxy
though I am fairly confident with dockers. I wrote my haproxy configuration via onine articles and blogs but as soon as I start my docker container using:
docker run --name my-running-haproxy \
-v ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
haproxy:1.6.2
I get the following error:
Error response from daemon: ./haproxy.cfg includes invalid characters for a local volume name, only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed
So I tried debugging by removing configuration options until I had a very minimalistic config:
haproxy.cfg
global
maxconn 256
debug
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http-in
bind *:80
default_backend default-server
backend default-server
server s0 127.0.0.1:3000
But still I am getting the same error.
Can anyone help me in this?