haproxy-dconv | HAProxy documentation converter | TLS library
kandi X-RAY | haproxy-dconv Summary
kandi X-RAY | haproxy-dconv Summary
HAProxy documentation converter
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert a list of files to a template
- Set the list of lines
- Convert a hctxt file
- Return the number of lines from the current line
- Get the git version from the current working directory
- Get the git version in a given path
- Removes indentation from a list
- Get the indent level
- Parse the line
- Render a table
- Parse a line
- Return number of empty lines
- Parse a single line of text
- Colorize text
- Parse a single line
- Parse a line of examples
- Parse table
haproxy-dconv Key Features
haproxy-dconv Examples and Code Snippets
Community Discussions
Trending Discussions on haproxy-dconv
QUESTION
I'm trying to setup HAProxy to deny requests from a user-agent blacklist, but it's not working.
I'm doing as explained in the answer: https://serverfault.com/a/616974/415429 (that is the example given in the official HAProxy docs: http://cbonte.github.io/haproxy-dconv/1.8/configuration.html#7)
The example in the official docs is: acl valid-ua hdr(user-agent) -f exact-ua.lst -i -f generic-ua.lst test
I've created a demo to simulate the issue of the user agent not working in a condition:
...ANSWER
Answered 2021-Mar-12 at 19:26I tried to dig the problem using curl, and I saw that I achieved the desired effect of returning 403 in the cases I tested.
Then I tried to use the entire user agent and it didn't work, so I tried to use just the beginning of the user agent and included the other parts, until when I included (KHTML, like Gecko)
and it stopped working.
So I ended up discovering that commas weren't working (tested with curl and a very simple test,comma
user agent). Then I found that HAProxy handles commas in list files differently, as per:
https://discourse.haproxy.org/t/comma-in-acl-list-file/2333/2
I was able to solve it with the solution provided in the above answer, using req.fhdr: req.fhdr(User-Agent)
instead of hdr(User-Agent)
.
According to the docs:
[...] It differs from req.hdr() in that any commas present in the value are returned and are not used as delimiters. This is sometimes useful with headers such as User-Agent.
(Weird that the official example of list files uses the user-agent header with hdr instead of req.fhdr, which can be misleading, and it was, for me at least)
QUESTION
I'd like to express the HAProxy condition
the request contains more than one
Transfer-Encoding
headers
so I can deny or reject such requests. I've scanned through the HAProxy documentation, but I couldn't find how to express that condition. Is it even possible?
...ANSWER
Answered 2020-Dec-11 at 16:28The req.hdr_cnt
or req.fhdr_cnt
fetches should be usable for your purpose. They return the number of occurrences of a particular request header. They differ in that req.hdr_cnt
counts comma-separated parts of a header value as distinct headers.
QUESTION
Sorry for the title which might sound like an "allready answered" topic but I believe my case is unique.
Also, this is my first post so I apologize if I am not on the proper channel as I am not sure wether my problem is on the server administration side or the Laravel's configuration one.
I am trying to get some fresh ideas on how to resolve an issue with Horizon / Predis / HAProxy which I thought was fixed but is showing up again.
Some details on environment- 2x Apache servers : PHP Version 7.2.29-1+ubuntu18.04.1+deb.sury.org+1
- thread safe is disabled and we use FPM
- 2x Redis servers using a simple master-slave setup (no high availability, no sentinel) : redis version 4.0.9
- load balancing with HAProxy version 1.9
- laravel/framework: 6.14.0
- laravel/horizon": 3.7.2
- redis/predis: 1.1.1
The Horizon daemon is managed through Supervisor.
This is the Redis client configuration in config/database.php
:
ANSWER
Answered 2020-Jul-10 at 09:33From Laravel documentation it is better to use PhpRedis client instead of Predis.
Predis has been abandoned by the package's original author and may be removed from Laravel in a future release.
In short, PhpRedis is a php module written in C. While Predis is php library written in PHP. Huge performance difference described here
BTW, we have similar stack: Laravel + Horizon -> HAProxy-> Redis Server. Wу have 3 redis servers (1 master, 2 slaves). And Sentinel to keep on actual master. And had similar problems with redis until we migrated from Predis to PhpRedis. When researching problems, the best answer was to use PhpRedis.
PS. We just changed REDIS_CLIENT in .env from Predis to phpredis and everything was still working.
QUESTION
We are using Clickhouse to store HAProxy and Kong logs and metrics.
The "pipeline" is built around the syslog protocol and rsyslog, as follow : HAProxy/Kong -> local rsyslog -> remote rsyslog (TCP) -> omclickhouse rsyslog module -> clickhouse.
The format of the syslog messages of course differs between HAProxy and Kong.
HAProxy messages look like this :
...ANSWER
Answered 2020-Jun-07 at 11:31I think transforming data outside ClickHouse is the right way.
Nevertheless, CH can take it upon itself. Let's consider for example JSON-logs and will use materialized view and rich set of json-related functions):
QUESTION
I have an HAProxy load balancer and I would like to allow access only to certain IPs. I know how to do this using the regular notation:
...ANSWER
Answered 2020-Mar-10 at 07:36After consulting with a colleague I found an answer.
QUESTION
I want to run the Redis with ReJson module on production Kubernetes.
Right now in staging, I am running single pod of Redis database as stateful sets.
There is a helm chart available? Can anyone please share it?
i have tried editing redis/stable
and stable/redis-ha
with redislabs/rejson
imaoge but it's not working.
What i have did
...ANSWER
Answered 2019-Oct-01 at 00:24Looks like Helm stable/redis has support to ReJson, as stated in the following PR (#7745):
This allows stable/redis to offer a higher degree of flexibility for those who may need to run images containing redis modules or based on a different linux distribution than what is currently offered by bitnami.
Several interesting test cases:
- [...]
helm upgrade --install redis-test ./stable/redis --set image.repository=redislabs/rejson --set image.tag=latest
The stable/redis-ha also has a PR (#7323) that may make the chart compatible with ReJson:
This also removes dependencies on very specific redis images thus allowing for use of any redis images.
QUESTION
Consider this minimal HAProxy 2.0 configuration
...ANSWER
Answered 2019-Jul-19 at 19:43This looks like to the bug which was just fixed BUG/MEDIUM: http/htx: unbreak option http_proxy. You can try to build a version with this fix or wait to the next version.
QUESTION
I have a server that needs to receive large (64K) GET requests. It looks like haproxy (v 1.6) has a compile-time limit of 16K. I'm hoping I missed something.
https://cbonte.github.io/haproxy-dconv/1.6/configuration.html#3.2-tune.bufsize
Any pointers other than recompiling haproxy?
Somewhat related, any insight why haproxy would return 400 and not 414 in such a case?
...ANSWER
Answered 2019-May-11 at 19:07I can provide an answer to the primary question. Despite the linked documentation, this appears not to be a compile-time option. It was enough to set
QUESTION
According to the HAProxy Configuration Reference, HAProxy uses an HTTP OPTIONS
request for HTTP health checks, by default, with option httpchk
.
Since I think it's implementation dependent whether web servers provide an HTTP OPTIONS
handler or not, I wonder why HAProxy uses this request type by default. Is there any reasonable technical background?
ANSWER
Answered 2019-Feb-26 at 06:59They write the reasoning in the documentation you link:
... When not set, the "OPTIONS" method is used, as it generally requires low server processing and is easy to filter out from the logs. ...
QUESTION
I understand that I can use url_param / urlp to extract the query parameters
from the URL that is requested, in HAProxy.
However, I need similar function for extracting parameters from the URL sent as HTTP Header field Referer
. I guess url_param
is only available for the requested URL, and not possible to use for HTTP Header values? If so, what other options do I have? I need to retrieve the value from query parameter and send it as specific HTTP Header to the backend server.
ANSWER
Answered 2018-Oct-24 at 19:35Sharing my solution (although Im not sure this is the most efficient and accurate way). I solved it with Regex.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install haproxy-dconv
You can use haproxy-dconv like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page