# Confused Reverse proxy and vaultwarden

**URL:** https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762
**Category:** General Discussion
**Created:** [24 September 2021 11:53 UTC](https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762 "2021-09-24T11:53:36Z")
**Posts on this page:** 1
**Showing post:** 52

<div class="post-metadata">

### Author: ![voldepi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/v/58956e/32.png) [@voldepi](https://dietpi.com/forum/u/voldepi)
#### Post date: [5 August 2022 13:20 UTC](https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762/52 "2022-08-05T13:20:33Z")

</div>

Hi!  
I am trying to configure lighttpd as a reverse proxy as [Joulinar] and [IIMustangII1151] described very clearly but lighttpd doesn’t seem to work.

When i am trying to access [domain.com/vault/](http://domain.com/vault/) I get back a “404 Not Found” page…

The steps I followed:  
(On a raspberry pi 4; model b. [DietPi: ARMv8])

- install vaultwarden, lighttpd
- install nextcloud
- I already have a domain in no-ip. My domain is like: subdomain.freedynamicdns. net
- I have already configured DDNS on my Router, not on my Pi.
- I created cers with dietpi-letsencrypt. (Force redirect http-\>https : ON. HSTS: OFF, OCSP: OFF)

I have configured my router to open ports 443, 80 (tcp & udp) and map with Pi’s mac address same ports (443 , 80)

Then:

```auto
nano /mnt/dietpi_userdata/vaultwarden/vaultwarden.env

```

I changed the following things as:

```auto
P_HEADER=X-Forwarded-For
WEBSOCKET_ENABLED=true
WEBSOCKET_ADDRESS=0.0.0.0
WEBSOCKET_PORT=3012
DOMAIN=https://subdomain.freedynamicdns.net
#ROCKET_TLS={certs="./cert.pem",key="./privkey.pem"}

```

Then:

```auto
nano /etc/lighttpd/conf-available/10-proxy.conf

```

```auto
$HTTP["host"] == "subdomain.freedynamicdns.net" {
    $HTTP["url"] =~ "^/notifications/hub($|/)" {
       # WebSocket proxy
       proxy.server = ( "" => ("vaultwarden" => ( "host" => " ***192.168.pi.ip***", "port" => 3012 )))
       proxy.forwarded = ("for" => 1 )
       proxy.header = (
           "upgrade" => "enable",
           "connect" => "enable"
       )
    } else {
    $HTTP["url"] =~ "^/vault($|/)" {
       proxy.server = ( "" => ("vaultwarden" => ( "host" => " ***192.168.pi.ip***", "port" => 8001 )))
       proxy.forwarded = ("for" => 1 )
       }
    }
}

```

Then I restarted the two services.

When I hit h-t-t-p-s://subdomain.freedynamicdns.net I get lighttpd landing page.

Also I can access next cloud at h-t-t-p-s://subdomain.freedynamicdns.net/nextcloud without any problem.

I can assume that everything related to lets-encrypt and ddns works fine.

I can access my vaultwarden at raspberry pi’s ip: h-t-t-p-://192.168.pi.ip:8001 so vaultwarden is up and running.

But when I am trying to access h-t-t-p-s://subdomain.freedynamicdns.net/vault/ I get the error page:

![image](https://dietpi.com/forum/uploads/default/original/2X/f/f34cf97c248d1ce616ff541342492d7915587e17.png)

(where subdomain is my domain)

I followed these instructions to try fix the error : [Fix lighttpd 404 not found error](https://ibmimedia.com/blog/49/fix-lighttpd-404-not-found-error)

So I added on /etc/lighttpd/lighttpd.conf :

```auto
server.max-fds = 2048

#directory listing
dir-listing.activate = "enable"
dir-listing.hide-dotfiles = "enable"
dir-listing.encoding = "utf-8"

```

But the result is the same.

I tried to be as specific as I can during the whole configuration.  
h-t-t-p-s format is because the forum rules do not permit more than one links.  
I am also not sure if I have to rewrite something else. For example if I should replace $HTTP[“host”] with $HTTP[“something-else”]

Can anyone help me or guide me on how to investigate the issue?  
Thank you in advance

---

_[View the full topic](https://dietpi.com/forum/t/confused-reverse-proxy-and-vaultwarden/5762)._
