A
A
Anton Valerievich2018-10-23 10:33:19
webmin
Anton Valerievich, 2018-10-23 10:33:19

How can you implement access to webmin through a subdomain, without specifying a port?

Hello!
There is a server on Debian 9. With the following configurations: Reverse Proxy Nginx+Apache2+SSL from Let's Encrypt+Webmin.
There is a certain domain mydomen.ru and there is access to Webmin by default mydomen.ru:10000.
There is a task to make access to Webmin instead of the default mydomen.ru:10000, for example, on the subdomain webmin.mydomen.ru
Tried through the config in NGiNX

server {
    listen 80;
    listen [::]:80;
    server_name webmin.mydomen.ru;
    access_log  /var/log/nginx/webmin_mydome.access.log;
    error_log   /var/log/nginx/webmin_mydome.error.log;
    return 301 https://$host$request_uri;
}
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    access_log  /var/log/nginx/webmin_mydome.access.log;
    error_log   /var/log/nginx/webmin_mydome.error.log;
    server_name webmin.mydomen.ru;
    ssl on;
    ssl_certificate /opt/ssl/fullchain.pem;
    ssl_certificate_key /opt/ssl/privkey.pem;
    client_max_body_size 100M;

    location / {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass http://127.0.0.1:10000;
    }
}

But the server sends me a 504 Gateway Time-out error.
There is a record in DNS dad A: webmin IP AAA.AAA.AAA.AAAA
I also tried to make an SRV record: _webmin._tcp.mydomen.ru 0 5 10000 webmin.mydomen.ru
The result is zero.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
ProfBiss, 2018-10-28
@ProfBiss

I think your webmin is not on 127.0.0.1:10000 but on your.external.ip:10000 looks
Replace proxy_pass http://127.0.0.1:10000; on proxy_pass http://mydomen.ru:10000;
If it works, look for how to rebind webmin to 127.0.0.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question