Having Trouble with Accessing Webmin without port

SYSTEM INFORMATION
OS type and version Debian 12.2 Bookworm
Webmin version 2.105

Hi I am trying to setup webmin so that i can access it with webmin.example.com but for some reason now any sub domain i i have setup will redirect to webmin and not to the appropriate server or page.

if i disable webmin reverse proxy then they all start working again. I dont know if its something in the configuration i have done wrong, and was hoping i could get some help to resolve this please.

atm i have a server running jellyfin, qbittorrent and webmin. I am able to configure jellyfin and qbt to connect without port with domains jellyfin.example.com and qbt.example.com. Each works fine but once i setup webmin to connect with webmin.example.com it makes all my other sub domains point to webmin too. so now i have jellyfin.example.com, qbt.example.com and webmin.example.com all pointing to my webmin page.

below is the configuration i have, i have also tried others but they always seem to point all sub domains to webmin.

user@jellyfin:~$ sudo nano /etc/webmin/config
**ADD TO BOTTOM***
referers=webmin.vconx.xyz

user@jellyfin:~$ sudo nano /etc/webmin/miniserv.conf
**ADD TO BOTTOM***
redirect_ssl=1
redirect_host=webmin.vconx.xyz

user@jellyfin:~$ sudo systemctl restart webmin

user@jellyfin:~$ sudo nano /etc/webmin/xterm/config
**ADD TO BOTTOM***
host=webmin.vconx.xyz

user@jellyfin:~$ sudo nano /etc/nginx/conf.d/webmin.conf

server {
   server_name webmin.example.com;

   # Enable SSL/TLS and HTTP2
   listen 00.00.00.00:443 ssl http2; <MY IP IS HERE:443>

   # Point to files with SSL certificates for virtual host
   ssl_certificate /etc/letsencrypt/live/webmin.example.com/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/webmin.example.com/privkey.pem;

   # Use only secure version of the TLS protocol (TLSv1.3)
   ssl_protocols TLSv1.3;
   ssl_prefer_server_ciphers off;

   # Disable proxying for all /.well-known requests. It will
   # only be useful, if a domain has "root" defined
   location ^~ /.well-known/ {
       try_files $uri /;
   }

   # Proxying both HTTP and websockets
   location / {
       proxy_pass https://localhost:10000/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection Upgrade;
       proxy_set_header Host $host;

       # Disable buffering to make progressive
       # output work as expected
       proxy_buffering off;
       proxy_request_buffering off;

       # Enable large file uploads
       client_max_body_size 64g;
   }
}

I’ve never setup Webmin proxied behind nginx, but it’s been discussed several times. This thread might help? Running Webmin Under Nginx · Issue #420 · webmin/webmin · GitHub

All those configs fail and i have tried them before. I managed to edit my webmin.conf file to work but its give me a small error when i do sudo nginx -t
see my server is hosted online (renting a server) so its already online my webmin not just local. the reason i want no port os to turn on proxy setting in cloudflare.

now it looks like this

server {
                root /var/www/html;
                server_name webmin.example.com;
                listen 443;
                listen [::]:443;
                location /.well-known
                {
                                auth_basic off;
                }
                #include /etc/nginx/ssl.conf;
                location /
                {
                                auth_basic off;
                                proxy_pass  https://my public ip:10000;
                                proxy_set_header Host $host;
                                proxy_set_header X-Real-IP $remote_addr;
                                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                                proxy_set_header X-Forwarded-Proto $scheme;
                                proxy_hide_header   Referer;
                                proxy_hide_header   Origin;
                                proxy_set_header    Referer                 '';
                                proxy_set_header    Origin                  '';
                }

    ssl_certificate /etc/letsencrypt/live/webmin.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/webmin.example.com/privkey.pem; # managed by Certbot

    add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot


    ssl_trusted_certificate /etc/letsencrypt/live/webmin.example.com/chain.pem; # managed by Certbot
    ssl_stapling on; # managed by Certbot
    ssl_stapling_verify on; # managed by Certbot

}

but when i run sudo nginx -t it returns

2024/03/05 07:00:46 [warn] 163259#163259: conflicting server name "webmin.example.com" on [::]:443, ignored
2024/03/05 07:00:46 [warn] 163259#163259: conflicting server name "webmin.example.com" on 0.0.0.0:443, ignored
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

it works now but i couldnt figure out how to fix the above errors.

Have a look at the FAQ:

1 Like

Why didn’t you say so? That’s a whole other question.

Just run Webmin on one of the several HTTPS ports Cloudflare will proxy, e.g. 8443. Network ports · Cloudflare Fundamentals docs

1 Like

FAQ is what i followed to make my reverse proxy work, but the conf file made all my urls point to webmin. then i edited the file a bit and finally got it working but with the 2 minor errors of conflicting server name i mentioned above.

originally i wanted to change webmin port but i couldnt find anything on how to change it. justa few posts in reddit or github that i didnt understand.

EDIT***
Good news is i worked out how to change port, it was as simple as editing the /etc/webmin/miniserv.conf changing lines 1 & 18, port= and listen=

I just wish i could work out how to resolve the conflicting server name errors in my webmin.conf file… but until then i am happy i have it on 8443 now. so just have to check with cloudflare if there is anything specific i need to do or if i can just enable proxy now…

thanks for the help much appreciated.

You could get a dedicated IP address and make only Webmin listen on it on port 443. That could also be one of the possible solutions.

What!? You don’t need a dedicated IP. Just a name that isn’t proxied. Any old name will do, could be a subdomain of one of your other domains.

If a user had an additional IP on the server, on which a webserver didn’t listen, then Webmin could directly listen on port 443 and therefore there would be no need for a proxy, as this configuration would be fully compatible with Cloudflare DNS.

But, you don’t need Cloudflare to be involved at all! That doesn’t make sense. You can have as many names as you want for free, and you can point them anywhere you want for free. No reason to get another IP address involved just for this.

Based on the title “accessing Webmin without port”, meaning that a user wants to access Webmin by webmin.domain.com and not webmin.domain.com:10000, the only solution to achieve this is to have a separate IP for Webmin to listen on and bind to port 443, so then accessing webmin.domain.com would just work with Webmin miniserv directly (without using a proxy, like Apache or Nginx)! :wink:

They wanted to do that because they thought they had to because Cloudflare.

Hi I dont need a separate IP and i have actually achieved accessing webmin via webmin.domain.com without port. after some tinkering i made it work, its just when i run nginx -t my webmin.conf file for reverse proxy is returning a warning saying

2024/03/05 07:00:46 [warn] 163259#163259: conflicting server name "webmin.example.com" on [::]:443, ignored
2024/03/05 07:00:46 [warn] 163259#163259: conflicting server name "webmin.example.com" on 0.0.0.0:443, ignored

I would like to know what i did wring to get this error of conflicting server name and would like it resolved. other then that everything is working now. I am able to access all my subdomains and they are all pointing to the appropriate pages they should be pointing to.

This error means that there is a configuration issue because the server name webmin.example.com is used in more than one server block for the same IP and port combination.

This means you’ll need to use a proxy, and your access to Webmin will depend on it. It might work, but I personally wouldn’t choose to use it.

i was trying to work out were the duplicate is but i couldnt locate it. ill eventually find it. i am not sure if its duplicate in the file or from another file eg; another reverse proxy for one of my other pages i access.

btw i just noticed that in my original post i has posted my actual url inside the preformatted text </> i had used. but i am unable to edit this post anymore not sure why I cant. are you able to edit it and change them to webmin.example.com please

its in 1st post were i show how i edited /webmin/config, miniserv.conf and xterm/config

thanks once edited i can mark as solved. i did manage getting it working and not affecting my other subdomains and i did manage to change the port. its just the ignored error, which i would probably have better luck finding on nginx website.

HI, i found when creating reverse proxy yes i was able to connect to webmin but it sort of broke, i had issues with showing stats and file manager didnt work properly anymore, i managed to fix it but it would take ages to load. and then i found that i couldnt download a file via file manager anymore…
I think to fix it, i changed referers_none=1 to referers_none=0

did i do something wrong?