Closed axeleroy closed 1 year ago
Little update: this behavior seem to only happen over HTTPS. When requesting over HTTP, I get the expected HTTP 403 response:
curl -k -v -H 'Host: google.com' http://192.168.0.112:8080/
* Trying 192.168.0.112:8080...
* Connected to 192.168.0.112 (192.168.0.112) port 8080 (#0)
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 403 Forbidden
< Server: nginx
< Date: Wed, 08 Feb 2023 11:00:11 GMT
< Content-Type: text/html
< Content-Length: 146
< Connection: keep-alive
<
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host 192.168.0.112 left intact
The behavior is exactly the same on a browser.
Hello @axeleroy,
It should be fixed in the v1.4.6 release.
Technical details : a self-signed certificates is generated and used for the default server. If HTTPS is used and DISABLE_DEFAULT_SERVER
is set to yes
client will get a 403 or a 444 according to DENY_HTTP_STATUS
.
Hello @fl0ppy-d1sk,
I updated to 1.4.6 following the release yesterday and the behavior has not changed. Do I need to change anything in my Docker Compose?
Hello @axeleroy,
Something went wrong with that feature on 1.4.6. We just released 1.4.7 which should fix it (again...).
Hello @fl0ppy-d1sk,
It's all good, it now displays the expected behavior and throws a 403 error.
Description To ease the deployment of my self-hosted services, I use a wildcard domain (ie.
*.selfhosting.domain.tld
) that points to BunkerWeb (so I don't have to log into my registar's console to add a domain for each new service).I recently realized that if the
Host
header requests a domain not in this list BunkerWeb will happily serve the first site inSERVER_NAME
even though I setDISABLE_DEFAULT_SERVER
toyes
.How to reproduce I'm using the Docker integration with Docker Compose (some details were omitted):
Now, if I use curl to GET with
Host
asfoo.selfhosting.domain.tld
or evengoogle.com
I get the content fromservice-a.domain.tld
!It also works through a browser: if I go to
https://foo.selfhosting.domain.tld
(and ignore the invalid SSL certificate) I get presented with the content fromservice-a.domain.tld
. Switching the order ofSERVER_NAME
will serve the content ofservice-b.selfhosting.domain.tld
.Logs
Logs aren't very helpful unfortunately: