2018-06-25 09:52:40 -05:00
<!DOCTYPE html>
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > iRedAdmin-Pro: Custom base url (/iredadmin)< / title >
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
< / head >
< body >
2019-07-13 06:21:55 -05:00
2018-06-25 09:52:40 -05:00
< div id = "navigation" >
< a href = "https://www.iredmail.org" target = "_blank" >
< img alt = "iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>
< span > iRedMail< / span >
< / a >
// < a href = "./index.html" > Document Index< / a > < / div > < h1 id = "iredadmin-pro-custom-base-url-iredadmin" > iRedAdmin-Pro: Custom base url (/iredadmin)< / h1 >
< p > If you want to replace the base url used to access iRedAdmin (< code > /iredadmin< / code > ) by,
for example, < code > /admin< / code > (from < code > https://< server> /iredadmin/< / code > to
< code > https://< server> /admin/< / code > ), you can update Nginx config file
< code > /etc/nginx/templates/iredadmin.tmpl< / code > and replace < code > /iredadmin< / code > defined in
< code > location< / code > and < code > rewrite< / code > , < code > uwsgi_param SCRIPT_NAME< / code > directives.< / p >
< p > Here's a working full example:< / p >
< pre > < code > # static files under /iredadmin/static
location ~ ^/admin/static/(.*) { # < - Changed
alias /var/www/iredadmin/static/$1;
}
# Handle newsletter-style subscription/unsubscription supported in iRedAdmin-Pro.
location ~ ^/newsletter/ {
rewrite /newsletter/(.*) /admin/newsletter/$1 last; # < - Changed
}
# Python scripts
location ~ ^/admin(.*) { # < - Changed
rewrite ^/admin(/.*)$ $1 break; # < - Changed
include /etc/nginx/templates/hsts.tmpl;
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi/iredadmin.socket;
uwsgi_param UWSGI_CHDIR /var/www/iredadmin;
uwsgi_param UWSGI_SCRIPT iredadmin;
uwsgi_param SCRIPT_NAME /admin; # < - Changed
# 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 = /admin { # < - Changed
rewrite ^ /admin/; # < - Changed
}
< / code > < / pre > < div class = "footer" >
2019-09-06 00:54:43 -05:00
< p style = "text-align: center; color: grey;" > All documents are available in < a href = "https://github.com/iredmail/docs/" > BitBucket repository< / a > , and published under < a href = "http://creativecommons.org/licenses/by-nd/3.0/us/" target = "_blank" > Creative Commons< / a > license. You can < a href = "https://github.com/iredmail/docs/archive/master.zip" > download the latest version< / a > for offline reading. If you found something wrong, please do < a href = "https://www.iredmail.org/contact.html" > contact us< / a > to fix it.< / p >
2018-06-25 09:52:40 -05:00
< / div >
<!-- Global site tag (gtag.js) - Google Analytics -->
< script async src = "https://www.googletagmanager.com/gtag/js?id=UA-3293801-21" > < / script >
< script >
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-3293801-21');
< / script >
< / body > < / html >