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

HAProxy not starting on a BananaPi M2 zero #28

Open
AlbertoRevelant opened this issue Sep 20, 2022 · 6 comments
Open

HAProxy not starting on a BananaPi M2 zero #28

AlbertoRevelant opened this issue Sep 20, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@AlbertoRevelant
Copy link

Hello,
with the latest version of the armbian distribution compiled for the bananapi m2 zero, the file /etc/haproxy/haproxy.cfg when parsed gives some errors due to the fact that certain functions have disabled between haproxy v2.0 and v2.1.
I have solved by downloading a hf_arm debian package of haproxy version 1.8, removed the latest version coming with the release and installed the older one. With the older package the haproxy config file works properly and it is possible to access octoprint from another machine using the IP address or the host name of the bananapi.

Regards
Alberto Revelant

@dzikk
Copy link

dzikk commented Sep 29, 2022

Hello
the same for orange pi pc

@pauluchin
Copy link

Same problem for orange pi lite

@dzikk
Copy link

dzikk commented Oct 3, 2022

Could you please tell me step by step with commands how I can proceed with replace haproxy to 1.8?

@RicardoLastKiller
Copy link

don't need to downgrade, just update your configuration:

/etc/haproxy/haproxy.cfg

global
        maxconn 4096
        user haproxy
        group haproxy
        log /dev/log local1 debug
        tune.ssl.default-dh-param 2048

defaults
        log     global
        mode    http
        compression algo gzip
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        option http-server-close
        option forwardfor
        maxconn 2000
        timeout connect 5s
        timeout client  15m
        timeout server  15m

frontend public
        bind :::80 v4v6
        bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem
        option forwardfor except 127.0.0.1
        use_backend webcam if { path_beg /webcam/ }
        use_backend webcam_hls if { path_beg /hls/ }
        use_backend webcam_hls if { path_beg /jpeg/ }
        default_backend octoprint

backend octoprint
        acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
        http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2
        http-request add-header X-Scheme https if needs_scheme { ssl_fc }
        http-request add-header X-Scheme http if needs_scheme !{ ssl_fc }
        option forwardfor
        server octoprint1 127.0.0.1:5000
        errorfile 503 /etc/haproxy/errors/503-no-octoprint.http

backend webcam
        http-request replace-path ^([^\ :]*)\ /webcam/(.*)     \1\ /\2
        server webcam1  127.0.0.1:8080
        errorfile 503 /etc/haproxy/errors/503-no-webcam.http

backend webcam_hls
        server webcam_hls_1 127.0.0.1:28126
        errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http

@AlbertoRevelant
Copy link
Author

I can confirm that the config file from Ricardo is working with the latest version of the haproxy package.

Thank you very much.

BR
Alberto

@ludiazv ludiazv self-assigned this Nov 22, 2022
@ludiazv ludiazv added the bug Something isn't working label Nov 22, 2022
@ludiazv
Copy link
Owner

ludiazv commented Nov 28, 2022

Fixed in the new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants