1

Topic: iRedmail/nginx adding website to home server

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.7 MARIADB edition
- Linux/BSD distribution name and version: Raspbian GNU/Linux 8 (jessie)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? : NO (OS iredadmin)
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Running: Roundcube (with a couple of addins; haven't dug into SOGo)
Running certbot-auto with a combine certificate (reasons for this in one of the other posts)

I have a function iRedmail server running and it's used for testing and home based emails. Since it has such low utilization I'd like to add a small website to it using the nginx as installed.  I've looked at the file structure for iRedMail and find it a bit confusing but I muddle through when fixing problems or finding things.

Being new to NGINX (I have experience with APACHE) I am leery of changing things without knowing the effects it will have on iRedMail/Roundcube.  Any help or direction would be appreciated.

Thanks...

----

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

2

Re: iRedmail/nginx adding website to home server

Just add a new config with the full "server {}" block in /etc/nginx/sites-available/, then create a symbol link of this vhost file to /etc/nginx/sites-enabled/, restart/reload Nginx. That's it.

You don't have to split config files into pieces under /etc/nginx/sites-conf.d/ like default iRedMail setting.

3

Re: iRedmail/nginx adding website to home server

ZhangHuangbin wrote:

Just add a new config with the full "server {}" block in /etc/nginx/sites-available/, then create a symbol link of this vhost file to /etc/nginx/sites-enabled/, restart/reload Nginx. That's it.

You don't have to split config files into pieces under /etc/nginx/sites-conf.d/ like default iRedMail setting.

I created this file: /etc/nginx/sites-available/917.freeddns.org

server {
        listen 443;
        listen [::]:443;

        root /var/www/917.freeddns.org/html;
        index index.html index.htm index.nginx-debian.html;

        server_name 917.freeddns.org www.917.freeddns.org;

        location / {
                try_files $uri $uri/ =404;
        }
}

performed:

ln -s /etc/nginx/sites-available/917.freeddns.org /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx

when I enter 917.freeddns.org in the address bar it redirects to 917.freeddns.org/mail/ and brings up the roundcube home page. This machine also hosts mythos.freeddns.org and it redirects to /mail/ as well.  I only want to change the function of the first FQDN and add a link to the page for accessing mail (this I can do).

4

Re: iRedmail/nginx adding website to home server

r.schnell wrote:

I created this file: /etc/nginx/sites-available/917.freeddns.org

File name must end with '.conf'. So it should be:
/etc/nginx/sites-available/917.freeddns.org.conf