bunkerweb icon indicating copy to clipboard operation
bunkerweb copied to clipboard

[BUG] Reverse proxy to a host without VirtualHost

Open GiovanniGit-IT opened this issue 1 month ago • 0 comments

What happened?

Hello,

I have a bunkerweb service : public.test.fr (domain is false, just for issue) I have in backend a vm private.test.fr (apache2) with multiples folders in /var/www/ and no virtualhost is set.

The reverse proxy host of this service is : private.test.fr/folder

I try to connect with this URL : https://public.test.fr and not work. MIME Problems, NS Redirect Loop etc, ...

I have try rewrite rule, disable reverse_proxy_intercept_errors, set a reverse proxy URL, a lot of tentatives but the only solutions is to set a custom config with that :

location /folder {
        proxy_pass "https://private.test.fr/folder";
	proxy_set_header Host $host;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-Proto $scheme;
	proxy_set_header X-Forwarded-Protocol $scheme;
	proxy_set_header X-Forwarded-Host $http_host;
}

And it's work with this URL : https://public.test.fr/folder but i need a URL with / prefix. Just : https://public.test.fr/ A Rewrite Rule in custom config (rewrite ^/folder/(.*)$ /$1 last;) not working too.

My question is : do you have a solution for the issue or VirtualHost mandatory need to be set in private.test.fr ?

Best regards,

How to reproduce?

A classical service bunkerweb with reverse proxied host A apache2 service with multiple folder in /var/www/ without VirtualHost

Configuration file(s) (yaml or .env)


Relevant log output


BunkerWeb version

1.6.6

What integration are you using?

Linux

Linux distribution (if applicable)

Debian 12

Removed private data

  • [x] I have removed all private data from the configuration file and the logs

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

GiovanniGit-IT avatar Dec 10 '25 14:12 GiovanniGit-IT