Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to configure HAProxy to convert GET requests to POST when sending to the backend servers?

The background of the problem is that we want to use a Cloud based logging service (e.g., which only allows log events to be created via POST to its REST API. Log events will be created via Javascript in a browser when our widget is loaded onto webpages, thus we can't do POST because of CSRF prevention.

Is there a better way to do this besides setting up a proxy that converts GETs into POSTs?

share|improve this question

Something like this should do the trick:

backend HttpServers
  mode http
  balance roundrobin
  option httpchk
  reqirep ^GET\s+(https?:/.*)$ POST\ \1

The key bit is the last line.

share|improve this answer

I'd recommend against generating the events in javascript on the client browser, for a multitude of reasons, security foremost.

Work with the vendor you choose to determine the best way to bring your web server logs into the service, but grabbing out that text file instead of trying to get client browsers to send requests directly to the event API will make your life much easier.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.