-
Notifications
You must be signed in to change notification settings - Fork 647
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
net/haproxy: Action rules are not sorted properly in haproxy.conf #1925
Comments
|
I was able to reproduce this issue. |
|
@fraenki these commits are likely not related (grid sorting shouldn't be used here). If you sort the config.xml, the output is as expected. My guess would be it's something related to Javascript (could be jquery). |
|
@AdSchellevis You're right, it looks like this was already broken in 20.1.4 (the oldest testbox I have available). :-/ |
|
I did a new test on both 20.1.8 and 20.7-RC1 and I have to correct my previous statement: rule sorting works as expected. However, there is one notable exception: I plan to remove the special handling of |
…pnsense#999 This partially reverts 1f9250e.
|
@fraenki The patch works as expected, the rules are created in order, but "Test syntax" results in this message: After digging into HAProxy docs and other sources it seems that HAProxy processes http-request rules before use_backend. So in order to avoid the warning message it is probably best to create the use_backend rules after the http-request rules. My use case is to redirect all http requests to https except those related to acme_challenges. When I got unpredictable results my first thought was that the order of the rules was the root of the problem. Perhaps I have to think of alternate ways to handle my use case, e.g. to process the http-https redirect on the backend instead. |
|
The HAProxy warning simply tells the user that the rules are placed in the wrong order. However, that's not a big issue, because (as stated by the warning message) HAProxy corrects this specific error internally. I am aware that these messages will now appear for some users. They can easily be fixed by changing the order of these rules. Still, I think it's a change for the better to have full control over the sort order. |
Describe the bug
Redirect rules are not processed in proper order which leads to unpredictable behaviour. This is problematic e.g. when using haproxy and Let's encrypt combined.
I have looked into the generated haproxy.conf and I can see that ACL:s are sorted according to the order of entries in frontend gui (Public services). But linked actions are generated in wrong order. In fact the order is not changed if the rule entries are shuffled in gui.
Screenshots

Example 1
Example 2

Environment
OPNsense 20.1.8_1-amd64
The text was updated successfully, but these errors were encountered: