Menu

redirect problem from 443 to 10000 after logi

Webmin
2008-04-16
2025-04-14
1 2 > >> (Page 1 of 2)
  • Florian Keller

    Florian Keller - 2008-04-16

    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

     
    • gandolf

      gandolf - 2008-04-19

      "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

       
      • Florian Keller

        Florian Keller - 2008-04-19

        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

         
        • gandolf

          gandolf - 2008-05-19

          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

           
    • Florian Keller

      Florian Keller - 2008-05-13

      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

       
      • gandolf

        gandolf - 2008-05-25

        from 443??? doesnt that imply using the openssl? does not webmin run its own ssl?

         
  • MUHAHA

    MUHAHA - 2015-06-07

    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

     
  • ochbob

    ochbob - 2016-01-21

    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
  • ochbob

    ochbob - 2016-04-12

    No one can help ? :(

     
    • MIchail Prosyanik

      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");

       
  • ochbob

    ochbob - 2016-04-19

    Thanks !

    That's work like a charm :)

     
  • Steve C

    Steve C - 2017-09-26

    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

     
    • Bob

      Bob - 2019-04-22

      youre a legend steve!

       
  • David Hagar

    David Hagar - 2017-12-04

    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.

     
  • Dmitry Ogurtsov

    Dmitry Ogurtsov - 2018-11-23

    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:

    https://webmin.example.com/apache/virt_index.cgi?virt=433&xnavigation=1
    

    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:

    https://webmin.example.com/apache/:10000/apache/virt_index.cgi?virt=433&xnavigation=1
    

    Above mentioned changes in miniserv.pl and web-lib-funcs.pl don't seem to change anything.
    Any hints and workarounds are welcome.

     
  • Ilia

    Ilia - 2018-11-23

    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?

     
  • Dmitry Ogurtsov

    Dmitry Ogurtsov - 2018-11-26

    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
  • Ilia

    Ilia - 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.

    1. Download, put it into theme directory and run the following debug file for printing enviromental data:
      https://gist.github.com/rostovtsev/d2ab909371a4e02fd1f18381aefd31e6
    2. When run, from your browser, as webmin.example.com/debug.cgi open the page source and copy structured data to your text editor;
    3. Filter-out/replace sensetive information;
    4. Post it here.
     
  • Dmitry Ogurtsov

    Dmitry Ogurtsov - 2018-11-26

    Here you go:

    HTTP_USER_AGENT  =>  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
    SERVER_ROOT  =>  /usr/share/webmin
    QUERY_STRING  =>  
    PWD  =>  /usr/share/webmin/
    REMOTE_USER  =>  user1
    HTTP_DNT  =>  1
    HTTP_X_FORWARDED_SERVER  =>  webmin.example.com
    HTTP_ACCEPT_LANGUAGE  =>  ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
    MINISERV_PID  =>  889
    WEBMIN_VAR  =>  /var/webmin
    REMOTE_ADDR_PROTOCOL  =>  4
    HTTP_ACCEPT  =>  text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    HTTP_X_FORWARDED_HOST  =>  webmin.example.com
    SERVER_SOFTWARE  =>  MiniServ/1.900
    PATH  =>  /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
    REMOTE_ADDR  =>  127.0.0.1
    HTTP_UPGRADE_INSECURE_REQUESTS  =>  1
    BASE_REMOTE_USER  =>  root
    HTTP_X_FORWARDED_FOR  =>  *.*.*.* --> (here is my current IP, from which I gain access to https:\\webmin.example.com via browser)
    PATH_INFO  =>  
    GATEWAY_INTERFACE  =>  CGI/1.1
    REQUEST_URI  =>  /debig.cgi
    SERVER_REALROOT  =>  
    REQUEST_METHOD  =>  GET
    DOCUMENT_REALROOT  =>  
    SERVER_PROTOCOL  =>  HTTP/1.0
    REMOTE_HOST  =>  127.0.0.1
    SERVER_PORT  =>  10000
    SERVER_NAME  =>  webmin.example.com
    LD_LIBRARY_PATH  =>  
    HTTPS  =>  ON
    DOCUMENT_ROOT  =>  /usr/share/webmin
    SCRIPT_NAME  =>  /debig.cgi
    HOME  =>  /root
    HTTP_ACCEPT_ENCODING  =>  gzip, deflate, br
    SCRIPT_FILENAME  =>  /usr/share/webmin/authentic-theme/debig.cgi
    WEBMIN_CONFIG  =>  /etc/webmin
    HTTP_HOST  =>  webmin.example.com
    HTTP_COOKIE  =>  _ym_uid=1537953692453780879; _ym_d=1537953692
    SERVER_ADMIN  =>  
    MINISERV_CONFIG  =>  /etc/webmin/miniserv.conf
    PERLLIB  =>  /usr/share/webmin
    HTTP_CONNECTION  =>  Keep-Alive
    
     

    Last edit: Dmitry Ogurtsov 2018-11-26
  • Dmitry Ogurtsov

    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.

     
  • Dmitry Ogurtsov

    Dmitry Ogurtsov - 2018-12-13

    Hi, is there any ETA for the this issue or a temporary fix?

     
  • Ilia

    Ilia - 2018-12-13

    I remember about this issue. I haven't had a chance to take a look yet.

     
  • Ilia

    Ilia - 2018-12-20

    Okay, looking at the issue.

    What about adding relative_redir=1 to /etc/webmin/config?

     
  • Ilia

    Ilia - 2018-12-20

    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-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.

     
  • Dmitry Ogurtsov

    Dmitry Ogurtsov - 2018-12-20

    Hi Ilia,

    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.

    Here is my Virtualhost config:

    <VirtualHost *:443>
    DocumentRoot /var/www/html/example.com
    ServerName webmin.example.com
    SSLEngine On
    SSLProxyEngine On
    SSLCertificateFile /etc/webmin/letsencrypt-cert.pem
    SSLCertificateKeyFile /etc/webmin/letsencrypt-key.pem
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass / https://127.0.0.1:10000/
    ProxyPassReverse / https://127.0.0.1:10000/
    <Directory /var/www/html/example.com>
    allow from all
    Options None
    Require all granted
    </Directory>
    </VirtualHost>
    
    <VirtualHost *>
    ServerName webmin.example.com
    RewriteEngine on
    RewriteCond %{HTTPS} =off
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge(.*) [NC]
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
    DocumentRoot /var/www/html/example.com
    </VirtualHost>
    

    Webmin config:

    path=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
    passwd_file=/etc/shadow
    passwd_uindex=0
    find_pid_command=ps auwwwx | grep NAME | grep -v grep | awk '{ print $2 }'
    ld_env=LD_LIBRARY_PATH
    passwd_pindex=1
    tempdelete_days=7
    passwd_mindex=4
    by_view=0
    passwd_cindex=2
    os_type=debian-linux
    os_version=9.0
    real_os_type=Ubuntu Linux
    real_os_version=18.04.1
    lang=en.UTF-8
    log=1
    referers_none=1
    md5pass=1
    theme=authentic-theme
    product=webmin
    webprefix=
    dateformat=dd/mon/yyyy
    help_width=
    hostnamemode=0
    help_height=
    feedback_to=
    sysinfo=0
    showlogin=0
    hostnamedisplay=
    nofeedbackcc=0
    showhost=0
    lang_root=ru.UTF-8
    realname=
    noremember=
    referer=webmin.example.com
    relative_redir=1
    error_stack=0
    
     
1 2 > >> (Page 1 of 2)

Log in to post a comment.

MongoDB Logo MongoDB