Help configuring lighttpd Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
lanznaster
Posts: 39
Joined: Thu Sep 05, 2019 10:26 am

Help configuring lighttpd

Post by lanznaster »

Hi,

I am trying, without success, settting up lighttpd to reverse proxy code-server app (https://github.com/cdr/code-server). I known this app is not part of dietpi, but someone might known how to do it.

I use lighttpd to reverseproxy some apps, and this one is the only one that I'm facing problems.

All apps were installed via docker.

On my lighttpd.conf, i add the following to reverseproxy an app:

$HTTP["url"] =~ "^/sonarr($|/)" {
proxy.server = ( "" =>
(( "host" => "192.168.1.94", "port" => 8989 ))
)
}

And its been working great, but I'm not sure what I'm missing.

I've searched about this, and tehy remove the option to use a base path, and that the the reverseproxy should rewrite requests.

https://github.com/cdr/code-server/discussions/1739

Does anyone known how to do this in lighttpd ?
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: Help configuring lighttpd

Post by MichaIng »

Please try to add the proxy.header option: https://redmine.lighttpd.net/projects/l ... s_ModProxy

Code: Select all

$HTTP["url"] =~ "^/sonarr($|/)" {
  proxy.header = (
    "map-urlpath" => (
      "/sonarr"  => ""
    )
  )
  proxy.server = ( "" =>
    (( "host" => "192.168.1.94", "port" => 8989 ))
  )
}
lanznaster
Posts: 39
Joined: Thu Sep 05, 2019 10:26 am

Re: Help configuring lighttpd

Post by lanznaster »

Sorry fo the late response. I've tried like that and no luck :( Sonarr service works, I'm having problems with this (code-server).

Code: Select all

$HTTP["url"] =~ "^/code($|/)" {
         proxy.header = (
   "map-urlpath" => ( "/code"  => "" )
  )

         proxy.server  = ( "" =>
        (( "host" => "192.168.1.94", "port" => 8443 ))
    )
}
The strange part is that it seens to get there, but insted of going to the login page, it says:
"401
Unauthorized"

I'll have a look at this documentation that you linked. Will let you know how it goes.
lanznaster
Posts: 39
Joined: Thu Sep 05, 2019 10:26 am

Re: Help configuring lighttpd

Post by lanznaster »

found this at the lighttpd error log (/var/log/lighttpd/error.log):

Code: Select all

2020-11-09 21:47:26: (server.c.1295) WARNING: unknown config-key: proxy.header (ignored)
lanznaster
Posts: 39
Joined: Thu Sep 05, 2019 10:26 am

Re: Help configuring lighttpd

Post by lanznaster »

Also just notice:

Code: Select all

proxy.header: options to perform simple remapping of host and URL paths in proxied HTTP headers (since 1.4.46)
My version is:

Code: Select all

root@DietPi:~# lighttpd -v
lighttpd/1.4.45 (/ssl) - a light and fast webserver
Build-Date: Jan 14 2017 21:07:19
Can I just update lighttpd?
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Help configuring lighttpd

Post by Joulinar »

what Debian version you are running? pls check.

Code: Select all

echo $G_DISTRO_NAME
I hope it's not Stretch as you need Buster to be able to upgrade lighttpd

https://packages.debian.org/de/lighttpd
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lanznaster
Posts: 39
Joined: Thu Sep 05, 2019 10:26 am

Re: Help configuring lighttpd

Post by lanznaster »

It is stretch :(
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Help configuring lighttpd

Post by Joulinar »

you are in same situation as this guy https://github.com/MichaIng/DietPi/issues/3808
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lanznaster
Posts: 39
Joined: Thu Sep 05, 2019 10:26 am

Re: Help configuring lighttpd

Post by lanznaster »

Thanks for the info, I have a spare raspberrypi, if I install a new dietpi image, will it install Buster?
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: Help configuring lighttpd

Post by Joulinar »

yes of course, Buster is the default since more than a year now ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply