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

DFP causes too many redirects on clients. #4

Closed
alshabib opened this issue Apr 15, 2018 · 4 comments
Closed

DFP causes too many redirects on clients. #4

alshabib opened this issue Apr 15, 2018 · 4 comments

Comments

@alshabib
Copy link
Contributor

alshabib commented Apr 15, 2018

Description

When using DFP to redirect http requests to https, the client accessing the url quits reporting too many redirects.

Steps to reproduce the issue:

  1. Create proxy network
  2. Create cert secret
  3. Deploy proxy-stack.yml and go-demo.yml
  4. curl -L https://test.mydomain.com/demo/hello (you may need to change domain)

Describe the results you received:

curl: (47) Maximum (50) redirects followed

Describe the results you expected:

Hello, World!

Additional information you deem important (e.g. issue happens only occasionally):

Previous versions of DFP did not have this problem (in particular, vfarcic/docker-flow-proxy:17.10.22-47).

Additional environment details (AWS, VirtualBox, physical, etc.):

DFP logs when the go-demo service is deployed. Here is a trace

Tried on AWS and Virtualbox environment.

@alshabib
Copy link
Contributor Author

I think i figured out whats happening. The generated HAProxy config is incorrect (see snippet below):

acl url_demo_main8080_0 path_beg / acl domain_demo_main8080_0 hdr_beg(host) -i test.mydomain.com use_backend demo_main-be8080_0 if url_demo_main8080_0 domain_demo_main8080_0 acl is_demo_main_http hdr(X-Forwarded-Proto) http http-request redirect scheme https if is_demo_main_http url_demo_main8080_0 domain_demo_main8080_0 acl is_demo_main_https hdr(X-Forwarded-Proto) https http-request redirect scheme https if !is_demo_main_https url_demo_main8080_0 domain_demo_main8080_0

should be

acl url_demo_main8080_0 path_beg / acl domain_demo_main8080_0 hdr_beg(host) -i test.mydomain.com acl is_demo_main_http hdr(X-Forwarded-Proto) http http-request redirect scheme https if is_demo_main_http url_demo_main8080_0 domain_demo_main8080_0 use_backend demo_main-be8080_0 if url_demo_main8080_0 domain_demo_main8080_0

I'll try to submit a patch for this if I can figure out where it is happening.

@vfarcic
Copy link
Contributor

vfarcic commented Apr 15, 2018

The patch should probably be applied to https://github.com/docker-flow/docker-flow-proxy/blob/master/proxy/template.go . Please let me know if you'll give it a try with a PR.

vfarcic added a commit that referenced this issue Apr 16, 2018
@vfarcic
Copy link
Contributor

vfarcic commented Apr 16, 2018

It's available starting from dockerflow/docker-flow-proxy:18.04.16-36.

@alshabib
Copy link
Contributor Author

alshabib commented Apr 16, 2018 via email

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

2 participants