1

Topic: Basic HTTP authentication on http://mydomain.com/iredadmin

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MYSQL edition
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Ubuntu Ubuntu 18.04.1 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.
====

I tried adding basic HTTP authentication on https://mydomain.com/iredadmin by modifying the file /etc/nginx/sites-available/00-default-ssl.conf.

However, it didn't work and had no effect asking username/password.  Can you teach me the proper way to configure?  I have installed phpmyadmin and such authentication works.

# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
    listen 443;
    server_name _;

    root /var/www/html;
    index index.php index.html;

    include /etc/nginx/templates/misc.tmpl;
    include /etc/nginx/templates/ssl.tmpl;
    include /etc/nginx/templates/iredadmin.tmpl;
    include /etc/nginx/templates/roundcube.tmpl;
    include /etc/nginx/templates/sogo.tmpl;
    include /etc/nginx/templates/netdata.tmpl;
    include /etc/nginx/templates/php-catchall.tmpl;
    include /etc/nginx/templates/stub_status.tmpl;

    # added this...but it didn't work
    location /iredadmin {
        auth_basic "Admin Login (iredadmin)";
        auth_basic_user_file /etc/nginx/pma_pass;
    }

    # this works for phpmyadmin
    location /phpmyadmin {
        auth_basic "Admin Login (phpmyadmin)";
        auth_basic_user_file /etc/nginx/pma_pass;
    }
}

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Basic HTTP authentication on http://mydomain.com/iredadmin

jw202 wrote:

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

Add it in file /etc/nginx/templates/iredadmin.tmpl.

3

Re: Basic HTTP authentication on http://mydomain.com/iredadmin

ZhangHuangbin wrote:
jw202 wrote:

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

Add it in file /etc/nginx/templates/iredadmin.tmpl.

Yes, it works! Thank you!