1

I am tring to use nginx and haproxy together. I am doing that because haproxy does not support gzip compression. My aim is that first using nginx for gzip compression than forward it to haproxy for loadbalance. I am Ok until that point. But while doing this, I want to create transparent proxy. Since nginx does not support tproxy, I used X-Forward-For header . Then in haproxy configuration I added source 0.0.0.0 usesrc hdr_ip(X-Forwarded-For,-1) line but i got 503 error code in my browser. Without that line they works fine but not the way I want.

Thank you for any help, I hope I could explain what I want:)

ibrahim
  • 431
  • 1
  • 7
  • 20
  • What are you proxying upstream? Why not enable compression there? – mahnsc Oct 14 '11 at 13:13
  • Sorry, but I didn't understand exactly what you mean by saying "proxying upstream". Briefly my aim is that if a gzip request come, unzip it than load balance it backend servers as non-gzip, finally send back to client as gzip. – ibrahim Oct 14 '11 at 13:22
  • if you mean way of a request by saying "upstream". It should be exactly like that client(gzip)->nginx(gzip)->haproxy(non-gzip)->webserver(non-gzip)->haproxy(non-gzip)->nginx(gzip)->client(gzip) means it's reverse proxy... – ibrahim Oct 14 '11 at 13:52
  • I mean, why don't you enable gzip compression on the web or app server instead of adding haproxy or nginx into the mix? – mahnsc Oct 14 '11 at 14:00
  • I solved problem by reorganizing iptables rules. Thank you for interested in mahnsc... – ibrahim Oct 15 '11 at 08:32

0 Answers0