Project

General

Profile

Lighttpd as reverse proxy

Added by Leer0r over 2 years ago

Hi,
I want to use lighttpd as a basic reverse proxy : My server is host on my port 8082 in localhost, and all my user are quering the 8081 port.
So my wish is to redirect queries like :

GET 192.168.x.x:8081 --> localhost:8082 --> 192.168.x.x:8081

The user recieve content served by my server, but the url doen't not change (still 192.168.x.x:8081)

I add on my conf file the following instruction :

$SERVER["socket"] == ":8081" {
  proxy.server = (
    "" => (
      "api:redirect" => (
        "host" => "127.0.0.1",
        "port" => "8082" 
      )
    )
  )
}

I also add proxy.debug = 3

but when I do a query, nothing work and the server never reply...

In my error.log, the proxy mod print only this : (/tmp/source/lighttpd-1.4.53/src/gw_backend.c.993) proc: tcp:127.0.0.1:8082 0 0 0 0

What did i do wrong ?
Thanks in advance

INFORMATIONS :
  • OS : armv5tejl GNU/Linux
  • Version : lighttpd 1.4.53 (ssl)
  • Client : Firefox

Replies (2)

RE: Lighttpd as reverse proxy - Added by gstrauss over 2 years ago

What did i do wrong ?

It sounds like you haven't read through the lighttpd documentation for mod_proxy.

RE: Lighttpd as reverse proxy - Added by gstrauss over 2 years ago

Important reading: How to get help

server.modules += ("mod_proxy")

    (1-2/2)