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

Support full spectrum of HAProxy rules #21

Closed
tamalsaha opened this issue Feb 22, 2017 · 6 comments

Comments

Projects
None yet
3 participants

@tamalsaha tamalsaha changed the title Rewrite rules should be supported for both request and response Support full spectrum of HAProxy rules Feb 22, 2017

@tamalsaha

This comment has been minimized.

Copy link
Member Author

commented May 5, 2017

From @skuda

I needed to add another haproxy rule to get phpmyadmin fully working

this is the final setup of one backend

   reqrep ^(GET|POST|HEAD)\ /1/(.*)     \1\ /\2

   acl hdr_location res.hdr(Location) -m found
   rspirep ^Location:\ (https?://phpmyadmin.local(:[0-9]+)?)?(/.*) Location:\ /1/ if hdr_location

   server server-10.200.65.19 10.200.65.19:80```

This way I got the rewrites needed, this is something that is accomplish in Apache mod_proxy with "ProxyPassReverse"

you can get the details here https://www.haproxy.com/blog/howto-write-apache-proxypass-rules-in-haproxy/ (edited)

without that I was able to see the home but every submit button was broken, because it directed to phpmyadmin.local, not phpmyadmin.local/1

@tamalsaha tamalsaha modified the milestone: 1.5.5 May 8, 2017

@tamalsaha

This comment has been minimized.

Copy link
Member Author

commented May 9, 2017

  • haproxyRule or rawRule key.
  • Array of strings
  • Prefix auto generated acls with __ prefix
@sadlil

This comment has been minimized.

Copy link
Contributor

commented May 9, 2017

If we use haproxyRule / backendRules then there is option that we can remove our current existing
headerRule and rewriteRule. But removing those won't be backward compatible. So should we mark those deprecated for now and introduce the new backendRule along side them? @tamalsaha

@tamalsaha

This comment has been minimized.

Copy link
Member Author

commented May 9, 2017

We will keep the old things as is. When we rewrite everything for the new TPR in 1.7, we will review these things. I think there is a good case to be made to have direct support for common HTTP rewrite rules.

@tamalsaha

This comment has been minimized.

Copy link
Member Author

commented May 22, 2017

@skuda, We have added new BackendRule that can used to add any custom acl rules for a backend. This can be used to add response headers. See docs here: https://github.com/appscode/voyager/blob/master/docs/user-guide/component/ingress/backend-rule.md

@skuda

This comment has been minimized.

Copy link

commented May 30, 2017

Tested, working fine, thanks!!

tamalsaha added a commit that referenced this issue Aug 17, 2018

Squashed 'hack/libbuild/' changes from d5b1ae3f..581ca8c0
581ca8c0 Rename cleanup to cleanup_test_stuff (#21)

git-subtree-dir: hack/libbuild
git-subtree-split: 581ca8c05daf1b334e5149a338c5a0757796f873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.