1

Topic: Subdomain

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Ubuntu 16.04.4 LTS (GNU/Linux 2.6.32-042stab127.2 x86_64)
- 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.
====

Hi, how can I set up to go from example.com/mail to mail.example.com for NGINX. I have searched the forum but didn't find exactly what I needed.

I saw on another post this link: https://www.nginx.com/resources/wiki/st … er_blocks/ but I don't know how to use it. Thank you.

I also saw a subdomain template in the roundcube folder, if that is usable, how do you use it?

Thanks.

----

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

2

Re: Subdomain

tmike wrote:

Hi, how can I set up to go from example.com/mail to mail.example.com for NGINX. I have searched the forum but didn't find exactly what I needed.

Hi,

here's a nice explanation how to set it up from the DNS to the server in Nginx

I also saw a subdomain template in the roundcube folder, if that is usable, how do you use it?

Thanks.

Roundcubemail will follow the subdomain, if part one has been set up properly.
Good luck.

3 (edited by alex42 2018-08-24 18:45:18)

Re: Subdomain

I wanted to archieve the same. So I created a new virtual host:

server {
  listen 80;
  listen [::]:80;
  server_name mail.domain.com;

  root /opt/www/roundcubemail;
  # Useful for Let's Encrypt
  location /.well-known/acme-challenge/ { allow all; }
  location / { return 301 https://$host$request_uri; }
}

server {
    listen 443 ssl http2;
    listen[::]:443 ssl http2;
    server_name mail.domain.com;

    root /opt/www/roundcubemail;
    index index.php index.html index.htm;

    include /etc/nginx/templates/roundcubemail-subdomain.tmpl;
}

I saved the file and created the necessary symlink:
But instead of running directly the roundcubemail-installation it opens the HTMl-file under /var/www/html/index.html (which, if it is not modified, then opens Roundcubemail under mail.domain.com/mail).

This is not what I wanted to archieve. I would like RC to be opened directly under mail.domain.com. How do I archieve this?

I've realized that if I delete the symlinks in /etc/nginx/sites-enabled/ to the virtual hosts created by iRedMail the connection just gets refused and the virtual host created by myself seems to be ignored.
Can someone help me?

4

Re: Subdomain

Found my error. I forgot to add a *.conf to the filename.