AW: Using NGINX as reverse proxy to webmin on a remote server

Francis Daly francis at daoine.org
Wed Apr 29 17:15:18 UTC 2020


On Mon, Apr 27, 2020 at 12:49:16PM +0000, Carsten Laun-De Lellis wrote:

Hi there,

Thanks for the pictures in your previous reply; they do give a bit of
a hint as to what is going on.

The "after-login" picture shows that /session_login.cgi does not exist
on nginx -- that is to be expected, because you want that link to go to
/vml000032/session_login.cgi instead. (Otherwise, you would not be able
to have two separate webmin instances in different places.)

> I've tried to configure my servers according to the link you sent, but it didn't work out.

It appears to be the case that webmin is not especially straightforward
to reverse-proxy at a non-root url.

>From the various web pages listed, it looks like there may be different
versions of webmin that do different things.

So if you are happy to keep testing and trying, there are perhaps a few
more things that you can try.

> The config on the Nginx server looks like:
> server {
>         server_name vml000036.delellis.net;
>         listen 192.168.178.36:80;
> 
>         location /vml000032 {
>                 proxy_pass      http://192.168.1.32:10000;
>                 proxy_set_header        Host         $host;

The linked web page seems to suggest that you want

  location /vml000032/ { # with the trailing /
    proxy_pass http://192.168.1.32:10000/; # with the trailing /
    proxy_set_header Host $host;
    proxy_redirect http://$host:10000/ /vml000032/;
  }

I suspect that you either want both of the last two lines, or neither
of them. You may be better of with neither; only testing will show.

> The webmin config on the upstream server looks like:

> webprefix=/vml000032
> webprefixnoredir=1
> referer=vml000036.delellis.net

That looks like it has a chance of working, so long as webmin is not
running with ssl.

Maybe webmin config also can use

  relative_redir=1

And it may be useful to edit miniserv.conf so that it includes

  cookiepath=/vml000032

> When I open the page in my webbrowser I get the logon screen to the webmin sever on my Nginx hostsystem. Not on vml000032.
> 

I suspect that that is because you used the line 

  proxy_set_header Host $host;

When the rest is working, you can perhaps try to log in using credentials
that are different on the two servers, and see which lets you in.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list