Project

General

Profile

[Solved] proxy to another service at port 8088?

Added by morrowwm 2 months ago

I want requests like https://myserver.net/w2/somecontent to be recognized by the "w2" and redirected to another service on the debian 11 lighttpd server. That second service (wiki.js) is listening on port 8088.

In lighttpd.conf:


$HTTP["url"] =~ "^/w2.*" {
    url.rewrite-once = ( "^/w2/(.*)$" => "/$1" )
    proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8088 ) ) )
}

Gives in the log:

2022-11-25 11:03:16: configfile-glue.c.646) === start of condition block ===
2022-11-25 11:03:16: configfile-glue.c.611) $HTTP["url"] =~ "^/w2.*" compare to /w2
2022-11-25 11:03:16: configfile-glue.c.350) 8 (uncached) result: true (cond: global / $HTTP["url"] =~ "^/w2.*")

but noting about the port.

Then later, the log shows the "w2" lingering.

2022-11-25 11:03:16: response.c.519) -- before doc_root
2022-11-25 11:03:16: response.c.521) Doc-Root     : /var/www/html
2022-11-25 11:03:16: response.c.523) Rel-Path     : /w2
2022-11-25 11:03:16: response.c.525) Path         : (null)
2022-11-25 11:03:16: response.c.558) -- after doc_root
2022-11-25 11:03:16: response.c.560) Doc-Root     : /var/www/html
2022-11-25 11:03:16: response.c.562) Rel-Path     : /w2
2022-11-25 11:03:16: response.c.564) Path         : /var/www/html/w2

There's no such page, so an error is returned. The log shows a number of errors associated with all the resources wiki.js is trying to use, for example:
2022-11-25 11:03:16: response.c.579) -- logical -> physical
2022-11-25 11:03:16: response.c.581) Doc-Root     : /var/www/html
2022-11-25 11:03:16: response.c.583) Basedir      : /var/www/html
2022-11-25 11:03:16: response.c.585) Rel-Path     : /_assets/js/runtime.js
2022-11-25 11:03:16: response.c.587) Path         : /var/www/html/_assets/js/runtime.js
2022-11-25 11:03:16: response.c.602) -- handling physical path
2022-11-25 11:03:16: response.c.604) Path         : /var/www/html/_assets/js/runtime.js
2022-11-25 11:03:16: response.c.205) -- file not found

Version is "lighttpd/1.4.59 (ssl) - a light and fast webserver".

Is this better done with haproxy?


Replies (1)

    (1-1/1)