Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project will not start if changes are not applied #1

Open
pozgo opened this issue Aug 25, 2022 · 0 comments
Open

Project will not start if changes are not applied #1

pozgo opened this issue Aug 25, 2022 · 0 comments

Comments

@pozgo
Copy link

pozgo commented Aug 25, 2022

In the docker-compose.yaml image: section needs to correspond to a valid image from Docker Hub.

should be

image: daro1337/bilziv-www:latest

haproxy.cfg

global and defaults cannot be left empty. HAProxy will not load due to missing timeouts. See example Error Log below

dariusz-adamczyk-haproxy-1  | [NOTICE]   (1) : haproxy version is 2.6.2-16a3646
dariusz-adamczyk-haproxy-1  | [WARNING]  (1) : config : missing timeouts for frontend 'web-front'.
dariusz-adamczyk-haproxy-1  |    | While not properly invalid, you will certainly encounter various problems
dariusz-adamczyk-haproxy-1  |    | with such a configuration. To fix this, please ensure that all following
dariusz-adamczyk-haproxy-1  |    | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
dariusz-adamczyk-haproxy-1  | [WARNING]  (1) : config : missing timeouts for backend 'web-front'.
dariusz-adamczyk-haproxy-1  |    | While not properly invalid, you will certainly encounter various problems
dariusz-adamczyk-haproxy-1  |    | with such a configuration. To fix this, please ensure that all following
dariusz-adamczyk-haproxy-1  |    | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
dariusz-adamczyk-haproxy-1  | [ALERT]    (1) : config : Proxy 'web-front': no SSL certificate specified for bind '*:443' at [/usr/local/etc/haproxy/haproxy.cfg:7] (use 'crt').
dariusz-adamczyk-haproxy-1  | [ALERT]    (1) : config : Fatal errors found in configuration.

bind to port 80 is not necessary since docker-compose.yaml is configured to respond and direct traffic via 443 only.

After changing the haproxy.cfg to as on example below project will start.

global
    stats socket /tmp/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners
    log stdout format raw local0 info

defaults
    mode http
    timeout client 10s
    timeout connect 5s
    timeout server 10s
    timeout http-request 10s
    log global

frontend web-front
    # bind *:80
    bind :443 ssl crt /usr/local/etc/haproxy/ssl/ssl.pem
    acl https ssl_fc
    http-request set-header X-Forwarded-Proto http  if !https
    http-request set-header X-Forwarded-Proto https if https
    mode http
    default_backend web-front

backend web-front
    mode http
    balance roundrobin
    server srv1 web1:80
    server srv2 web2:80

Side note:

The creation of the SSL certificate could be a simple BASH script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant