GithubHelp home page GithubHelp logo

Comments (3)

tifayuki avatar tifayuki commented on August 15, 2024

True, but we cannot tell if the incoming request is http or https only based on port number.

In Case 1, the fix could be separate port 80 and 443 into two different frontend.

In Case 2, part of the logs shows:

frontend port_443
  bind :443 ssl crt /certs/
  reqadd X-Forwarded-Proto:\ https
  acl is_websocket hdr(Upgrade) -i WebSocket
  acl host_rule_2 hdr_reg(host) -i ^.*$
  acl host_rule_2_port hdr_reg(host) -i ^.*:443$
  use_backend SERVICE_WEB if host_rule_2 or host_rule_2_port
frontend port_80
  bind :80
  acl is_websocket hdr(Upgrade) -i WebSocket
  acl host_rule_1 hdr_reg(host) -i ^.*$
  acl host_rule_1_port hdr_reg(host) -i ^.*:80$
  use_backend SERVICE_WEB if host_rule_1 or host_rule_1_port

I think this is as expected. The 443 frontend has the correct x-forwarded-proto, and the 80 frontend doesn't have it because it is not specify by EXTRA_SETTINGS explicitly.

from dockercloud-haproxy.

tifayuki avatar tifayuki commented on August 15, 2024

Fixed in version 1.4

from dockercloud-haproxy.

nickbreen avatar nickbreen commented on August 15, 2024

True, but we cannot tell if the incoming request is http or https only based on port number.
Out of curiosity, why is this the case?

I (naively) assumed that it would have been safe to assume that the ports dictated the protocol based on the frontends' configurations.

from dockercloud-haproxy.

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.