Sign inSign up

ruo91/haproxy

By ruo91

Updated about 1 year ago

Image
0

2.0K

ruo91/haproxy repository overview

Dockerfile - HAProxy

- Run
root@ruo91:~# docker run -d --name="haproxy" -h "haproxy" -p 8080:80 ruo91/haproxy

or

- Build
root@ruo91:~# docker build --rm -t haproxy https://github.com/ruo91/docker-haproxy.git
- Run
root@ruo91:~# docker run -d --name="haproxy" -h "haproxy" -p 8080:80 haproxy
- Reverse proxy settings of Nginx
root@ruo91:~# nano /etc/nginx/nginx.conf
http {
.............
...................
.......................
# HAProxy status
server {
    listen  80;
    server_name haproxy.yongbok.net;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:8080;
        client_max_body_size 10M;
    }
}
.......................
...................
.............
}
root@ruo91:~# nginx -t 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@ruo91:~# nginx -s reload
- HAProxy Status

![Status][0]

Thanks. :-) [0]: http://cdn.yongbok.net/ruo91/img/docker/haproxy/haproxy.png

Tag summary

Content type

Image

Digest

sha256:e60eda052

Size

153.4 MB

Last updated

about 11 years ago

docker pull ruo91/haproxy