Topic: Restrict access to iredadmin NGINX
I saw "Restrict access to iredadmin NGINX" topic was closed (https://forum.iredmail.org/topic10831-i … nginx.html) and I reopened because I have tried the solution provided in previous topic and is not working.
Can anyone please help me here ?
here are the settings in /etc/nginx/templates/iredadmin.tmpl
# Settings for iRedAdmin.
# static files under /iredadmin/static
location ~ ^/iredadmin/static/(.*) {
alias /opt/www/iredadmin/static/$1;
}
# Python scripts
location ~ ^/iredadmin(.*) {
rewrite ^/iredadmin(/.*)$ $1 break;
include /etc/nginx/templates/hsts.tmpl;
include uwsgi_params;
uwsgi_pass 127.0.0.1:7791;
uwsgi_param UWSGI_CHDIR /opt/www/iredadmin;
uwsgi_param UWSGI_SCRIPT iredadmin;
uwsgi_param SCRIPT_NAME /iredadmin;
# Access control
# allow 127.0.0.1;
# allow 192.168.3.223;
# allow 192.168.0.0/22;
# deny all;
}
# iRedAdmin: redirect /iredadmin to /iredadmin/
location = /iredadmin {
rewrite ^ /iredadmin/;
}
# Handle newsletter-style subscription/unsubscription supported in iRedAdmin-Pro.
location ~ ^/newsletter/ {
rewrite /newsletter/(.*) /iredadmin/newsletter/$1 last;
}
If de-comment in Access control block will block access.
Thank you in advance.
I would like to fix this instead of working with .htaccess.
----------------------------------------------------------------------------------------------------------------
- iRedMail version 1.5.1 :
- Deployed with installer
- Linux/Ubuntu 20.04
- Nginx
- Stored mail accounts LDAP
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.