Giter Club home page Giter Club logo

Comments (3)

aslansutu avatar aslansutu commented on June 21, 2024

When I set the USER as root and built the image, this time I came accross the following error

haproxy_1        | [NOTICE]   (16) : haproxy version is 2.9.7-5742051
haproxy_1        | [ALERT]    (16) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:13] : The 'reqadd' directive is not supported anymore since HAProxy 2.1. Use 'http-request add-header' instead.
haproxy_1        | [ALERT]    (16) : config : parsing [/usr/local/etc/haproxy/haproxy.cfg:58] : The 'reqadd' directive is not supported anymore since HAProxy 2.1. Use 'http-request add-header' instead.
haproxy_1        | [ALERT]    (16) : config : Error(s) found in configuration file : /usr/local/etc/haproxy/haproxy.cfg
haproxy_1        | [ALERT]    (16) : config : Fatal errors found in configuration.

It turns out that in src/haproxy/haproxy.cfg, the following has to be changed from

reqadd X-Forwarded-Proto:\ http
reqadd X-Forwarded-Proto:\ https

to

http-request set-header X-Forwarded-Proto http
http-request set-header X-Forwarded-Proto https

as explained here

from open-balena.

MauritsMonteyne avatar MauritsMonteyne commented on June 21, 2024

Ran into the same issue and posted my solution on the OpenBalena forum. I modified the Dockfile to to only temporarily switch to the root user as running a container as root is considered a bad practise.

FROM haproxy:2.9.6-alpine

VOLUME [ "/certs" ]

# Switch back to root to install packages
USER root

RUN apk add --update inotify-tools

# Make haproxy user owner of certificate directory (is root by default)
RUN chown haproxy:haproxy /etc/ssl/private

# Switch back to haproxy user
USER haproxy 

COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
COPY start-haproxy.sh /start-haproxy

CMD /start-haproxy

https://forums.balena.io/t/logbackend-server-responded-with-status-code-504-mystery-solved/369223/10

from open-balena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.