I've a problem with webmin. I've configured a Lighttpd as a reverse proxy. The reverse proxy works well and transfer all request to webmin. But it seems that webmin has a redirect in the Login Page. After login there's strange redirect to port 10000. When I change again to 443 (lighthttp) it works and I'm logged in. But the redirect shouldn't be there .. :-).
Have someone here solved this issue? Hope there is a other way then search and patch the miniserv webserver.
webmin config as described in FAQ:
referers_none=1
webprefixnoredir=1
referer=myhostname-replaced-:-)
Thanks and greetings
Florian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are funny :-), I said Im using a reverse proxy instead of perl ssleay for using SSL.
I don't want to use miniserv (own daemon) cause it lacks on a good/secure SSL implementation. I use a own WebServer as reverseproxy (lighttp), and yes thats possible and described in webmin FAQ. But after first Login there is a redirect from miniserv webserver to 10'000 and that sucks.
Best regards
Florian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
interesting. good to know. fyi jamie is googles top hw guy. so perhaps you might consider your patch a workaround? (ie does your newline work in the normal env?) tyia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
on webmin host edit file /usr/libexec/webmin/miniserv.pl
and on line 4043 replace
&write_data("Location: $prot://$hostport$in{'page'}\r\n");
to
&write_data("Location: $prot://$host$in{'page'}\r\n");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In addtion to miniserv.pl, you may need to change web-lib-funcs.pl in /usr/share/webmin
The line(s) in question are under the section "=head2 redirect(url)" and contain:
$url = "$prot://$ENV{'SERVER_NAME'}$port
I had to remove "$port" to be able to edit the firewall in Webmin when accessing through HAProxy. Now all works well (no redirects to 10000!) when running through HAProxy over 443
HTH
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know that this is an old thread... I'm using HAProxy as well, with the current version (1.860) of webmin, making the changes suggested solves the redirect problem, however, it does cause another issue where command stall out when htiting save. Just thought I'd throw it out there, I'm just going to let the system redirect to port 10000, I don't like it, but I'm tired of altering source code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a similar issue with WEBMIN 1.900 in Apache service:
so my my webmin is available at domain https:\webmin.example.com
everything works fine, but when I edit the virtual hosts the link corrutps the following way:
before editing:
after pressing "Save" the changes are actually saved but there is endless process indication on a Save button, because it's trying to return to a wrong return link:
Can you please post your Apache/Webmin configuration. It seems like it needs a fix. You are using miniserv and just proxing to it, using Apache, right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right, apache just proxies miniserv.
Actually I found out that this problem is present not only within Apache module, but in ALL Save buttons in all modules and menus of Webmin. It looks like 10000 port is hardcoded in a button code, there should some return URL.
In all other aspects, except this button problem, Webmin via proxy works fine. If use 192.168.0.110:10000 to access webmin, the Save buttons works fine.
Last edit: Dmitry Ogurtsov 2018-11-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's not because the port is hardcoded. It's because I made all possible tests with Webmin running under the directory and not sub-domain, i.e. https://example.com/webmin would work just fine.
Dmitriy, you could help me out to speed up the sovling process of this issue, please do the following. Should only take few minutes.
I have done real-life tests. I can not reproduce it, with at least, my way of setting up Apache and Webmin ( to make it work as virtual-server). I have set it up working under webmin.debug-centos-proxy and there were no issues with redirects upon form saving.
In case you still having this issue and the solution above (previous comment) doesn't work, please let me know.
I would like to ask you to post your Webmin and Apache relevant configuration anyway, for the future reference.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
relative_redir=1 seems to have solved the ** Save button** issue, thanks .
The only issue left is redirect to https://webmin.example.com:10000 after login. Solved easily by deleting :10000 and pressing Enter , but I have to do it after each login, so it looks like a bug.
Dear Community
I've a problem with webmin. I've configured a Lighttpd as a reverse proxy. The reverse proxy works well and transfer all request to webmin. But it seems that webmin has a redirect in the Login Page. After login there's strange redirect to port 10000. When I change again to 443 (lighthttp) it works and I'm logged in. But the redirect shouldn't be there .. :-).
Have someone here solved this issue? Hope there is a other way then search and patch the miniserv webserver.
webmin config as described in FAQ:
referers_none=1
webprefixnoredir=1
referer=myhostname-replaced-:-)
Thanks and greetings
Florian
"But it seems that webmin has a redirect in the Login Page."
no. should not be. webmin runs its own daemon. on 10000. use https://IP:10000
You are funny :-), I said Im using a reverse proxy instead of perl ssleay for using SSL.
I don't want to use miniserv (own daemon) cause it lacks on a good/secure SSL implementation. I use a own WebServer as reverseproxy (lighttp), and yes thats possible and described in webmin FAQ. But after first Login there is a redirect from miniserv webserver to 10'000 and that sucks.
Best regards
Florian
interesting. good to know. fyi jamie is googles top hw guy. so perhaps you might consider your patch a workaround? (ie does your newline work in the normal env?) tyia
If anyone other got this Problem, I've solved it. Patched the miniserv WebServer and Changed the following line:
From: 3521 &write_data("Location: $prot://$host$portstr$in{'page'}\r\n");
To: 3521 &write_data("Location: https://$host$in{'page'}\r\n");
Now everything works fine. :-).
Best regards,
Florian Keller
from 443??? doesnt that imply using the openssl? does not webmin run its own ssl?
Same problem here. Redirect in login page to :10000 port. It is not patched?
<virtualhost *:80="">
ServerAdmin admin@example.com
ServerName example.example.com
RewriteEngine On
RewriteCond %{SERVER_PORT} =80
RewriteRule ^/(.*)$ https://%{SERVER_NAME}:443/$1 [R,L]
</virtualhost>
<virtualhost *:443="">
ServerAdmin admin@example.com
ServerName torrents.example.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
ProxyRequests Off
ProxyPreserveHost On
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
<proxy *="">
Order deny,allow
Allow from all
</proxy>
# webmin
ProxyPass /webmin/ https://127.0.0.1:10000/
ProxyPassReverse /webmin/ https://127.0.0.1:10000/
</virtualhost>
/etc/webmin/config
md5pass=1
path=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
passwd_mindex=4
real_os_version=15.04
os_version=3.1
passwd_cindex=2
real_os_type=Ubuntu Linux
webprefix=/webmin
product=webmin
passwd_pindex=1
find_pid_command=ps auwwwx | grep NAME | grep -v grep | awk '{ print $2 }'
referers_none=1
theme=gray-theme
lang=en.UTF-8
webprefixnoredir=1
passwd_uindex=0
ld_env=LD_LIBRARY_PATH
log=1
tempdelete_days=7
referer=127.0.0.1
passwd_file=/etc/shadow
os_type=debian-linux
by_view=0
/etc/webmin/miniserv.conf
port=10000
addtype_cgi=internal/cgi
realm=Webmin Server
logfile=/var/webmin/miniserv.log
errorlog=/var/webmin/miniserv.error
pidfile=/var/webmin/miniserv.pid
logtime=168
ppath=
ssl=1
no_ssl2=1
no_ssl3=1
env_WEBMIN_CONFIG=/etc/webmin
env_WEBMIN_VAR=/var/webmin
atboot=1
logout=/etc/webmin/logout-flag
listen=10000
denyfile=.pl$
log=1
blockhost_failures=5
blockhost_time=60
syslog=1
session=1
premodules=WebminCore
userfile=/etc/webmin/miniserv.users
keyfile=/etc/webmin/miniserv.pem
passwd_file=/etc/shadow
passwd_uindex=0
passwd_pindex=1
passwd_cindex=2
passwd_mindex=4
passwd_mode=0
preroot=gray-theme
passdelay=1
cipher_list_def=1
sudo=1
root=/usr/share/webmin
mimetypes=/usr/share/webmin/mime.types
server=MiniServ/1.750
Hi :)
I use HAProxy and i have the same problem describe by F Keller
After first Login there is a redirect from miniserv webserver to 10000 and redirect is stuck but if i reload the page, everythings is OK.
Anyone found the solution ? @Florian Keller patchs seems to not work at all i can't find out the line in miniserv.pl ( /usr/share/webmin )
Thx :)
Last edit: ochbob 2016-01-21
No one can help ? :(
on webmin host edit file /usr/libexec/webmin/miniserv.pl
and on line 4043 replace
&write_data("Location: $prot://$hostport$in{'page'}\r\n");
to
&write_data("Location: $prot://$host$in{'page'}\r\n");
Thanks !
That's work like a charm :)
In addtion to miniserv.pl, you may need to change web-lib-funcs.pl in /usr/share/webmin
The line(s) in question are under the section "=head2 redirect(url)" and contain:
$url = "$prot://$ENV{'SERVER_NAME'}$port
I had to remove "$port" to be able to edit the firewall in Webmin when accessing through HAProxy. Now all works well (no redirects to 10000!) when running through HAProxy over 443
HTH
youre a legend steve!
I know that this is an old thread... I'm using HAProxy as well, with the current version (1.860) of webmin, making the changes suggested solves the redirect problem, however, it does cause another issue where command stall out when htiting save. Just thought I'd throw it out there, I'm just going to let the system redirect to port 10000, I don't like it, but I'm tired of altering source code.
I have a similar issue with WEBMIN 1.900 in Apache service:
so my my webmin is available at domain https:\webmin.example.com
everything works fine, but when I edit the virtual hosts the link corrutps the following way:
before editing:
after pressing "Save" the changes are actually saved but there is endless process indication on a Save button, because it's trying to return to a wrong return link:
Above mentioned changes in miniserv.pl and web-lib-funcs.pl don't seem to change anything.
Any hints and workarounds are welcome.
Can you please post your Apache/Webmin configuration. It seems like it needs a fix. You are using miniserv and just proxing to it, using Apache, right?
You are right, apache just proxies miniserv.
Actually I found out that this problem is present not only within Apache module, but in ALL Save buttons in all modules and menus of Webmin. It looks like 10000 port is hardcoded in a button code, there should some return URL.
In all other aspects, except this button problem, Webmin via proxy works fine. If use 192.168.0.110:10000 to access webmin, the Save buttons works fine.
Last edit: Dmitry Ogurtsov 2018-11-26
It's not because the port is hardcoded. It's because I made all possible tests with Webmin running under the directory and not sub-domain, i.e. https://example.com/webmin would work just fine.
Dmitriy, you could help me out to speed up the sovling process of this issue, please do the following. Should only take few minutes.
https://gist.github.com/rostovtsev/d2ab909371a4e02fd1f18381aefd31e6
Here you go:
Last edit: Dmitry Ogurtsov 2018-11-26
BTW, there is the same problem when you login webmin from moble devices: after entering user/password, the redirect goes to https://webmin.example.com:10000/sysinfo.cgi?xnavigation=1
I guess, the reason is the same.
Hi, is there any ETA for the this issue or a temporary fix?
I remember about this issue. I haven't had a chance to take a look yet.
Okay, looking at the issue.
What about adding
relative_redir=1to/etc/webmin/config?Dima, hi again.
I have done real-life tests. I can not reproduce it, with at least, my way of setting up Apache and Webmin ( to make it work as virtual-server). I have set it up working under
webmin.debug-centos-proxyand there were no issues with redirects upon form saving.In case you still having this issue and the solution above (previous comment) doesn't work, please let me know.
I would like to ask you to post your Webmin and Apache relevant configuration anyway, for the future reference.
Hi Ilia,
relative_redir=1seems to have solved the ** Save button** issue, thanks .The only issue left is redirect to
https://webmin.example.com:10000after login. Solved easily by deleting:10000and pressing Enter , but I have to do it after each login, so it looks like a bug.Here is my Virtualhost config:
Webmin config: