1

Topic: Change of url of example.com/iredadmin to something obfuscated

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL/MariaDB
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====


Hi,

I recently installed IRedMail and I like it a lot! Having an email-Server on my own is really wonderful and useful. Thank you for offering this.

But I'd like to do some minor tweaking.

The IredAdmin-Panel is available under example.com/iredadmin. In order to enhance security I'd like to change it to something like example.com/sdfnqo0fnf3. I noticed in my server logs that sometimes this page is requested but not from me. I would sleep quieter if I could hide it better.

I tried to find it out by myself, but I didn't suceeded.


Thank you.

Micha

2

Re: Change of url of example.com/iredadmin to something obfuscated

Update file /etc/nginx/templates/iredadmin.tmpl, replace the '/iredadmin' in url by your "/sdfnqo0fnf3", then restart Nginx service.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: Change of url of example.com/iredadmin to something obfuscated

ZhangHuangbin wrote:

Update file /etc/nginx/templates/iredadmin.tmpl, replace the '/iredadmin' in url by your "/sdfnqo0fnf3", then restart Nginx service.


Hi ZhangHuangbin,

thank you for your reply.

I replaced every /iredadmin in /etc/nginx/templates/iredadmin.tmpl to /uuuuu (to make it more legible for this forum).
It worked, but now the CSS seems to be broken since it looks like this now (please see attached jpg).

The iredadmin.tmpl looks as follows:


# Settings for iRedAdmin.

# static files under /iredadmin/static
location ~ ^/uuuuu/static/(.*) {
    alias /var/www/uuuuu/static/$1;
}

# Handle newsletter-style subscription/unsubscription supported in iRedAdmin-Pro.
location ~ ^/newsletter/ {
    include /etc/nginx/templates/hsts.tmpl;

    include uwsgi_params;
    uwsgi_pass unix:/run/uwsgi/iredadmin.socket;
    uwsgi_param UWSGI_CHDIR /var/www/uuuuu;
    uwsgi_param UWSGI_SCRIPT iredadmin;
    uwsgi_param SCRIPT_NAME /uuuuu;
    uwsgi_param REQUEST_URI /uuuuu/$request_uri;
}

# Python scripts
location ~ ^/uuuuu(.*) {
    rewrite ^/uuuuu(/.*)$ $1 break;

    include /etc/nginx/templates/hsts.tmpl;

    include uwsgi_params;
    uwsgi_pass unix:/run/uwsgi/iredadmin.socket;
    uwsgi_param UWSGI_CHDIR /var/www/uuuuu;
    uwsgi_param UWSGI_SCRIPT iredadmin;
    uwsgi_param SCRIPT_NAME /uuuuu;

    # Access control
    #allow 127.0.0.1;
    #allow 192.168.1.10;
    #allow 192.168.1.0/24;
    #deny all;
}

# iRedAdmin: redirect /iredadmin to /iredadmin/
location = /uuuuu {
    rewrite ^ /uuuuu/;
}



I guess I am continuously missing something. Would you mind giving me a hint?

Thank you

Micha


P.S. I bought you a coffee.

Post's attachments

se1.jpg
se1.jpg 195.65 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

4

Re: Change of url of example.com/iredadmin to something obfuscated

I had this problem when upgrading the template file.  Basically, the css/js is located in in its own dir. On my Debian box this is at:

/opt/www/iredadmin/static/

Looking at your config file, you've changed the actual directory where the css/js is loaded from, not just the url. Change it back like so:

# static files under /iredadmin/static
location ~ ^/uuuuu/static/(.*) {
#    alias /var/www/uuuuu/static/$1; WRONG
       alias /var/www/iredadmin/static/$1;
}

5

Re: Change of url of example.com/iredadmin to something obfuscated

Hi StephGreg,

that did it!

Thank you very much for your advice!

Micha