1

Topic: disable 301 redirect for new subdomain

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.2 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Debian 11
- 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 have a functional iRedMail but i`d like to install Baïkal calDAV server.
The content of "/etc/nginx/sites-available/baikal.conf" is the following:

server {
  listen       80;
  server_name  naptar.mysite.com;

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

  rewrite ^/.well-known/caldav /dav.php redirect;
  rewrite ^/.well-known/carddav /dav.php redirect;

  charset utf-8;

  location ~ /(\.ht|Core|Specific|config) {
    deny all;
    return 404;
  }

  location ~ ^(.+\.php)(.*)$ {
    try_files $fastcgi_script_name =404;
    include        /etc/nginx/fastcgi_params;
    fastcgi_split_path_info  ^(.+\.php)(.*)$;
    fastcgi_pass   127:0:0:1:9999;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;
  }
}

When I go to naptar.mysite.com in the address bar it redirects to naptar.mysite.com/mail/ and brings up the roundcube home page.
With curl -v or curl --head there is an active 301 redirect?
How can I disable this redirect for this subdomain?

Thank you in advance.

----

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

2

Re: disable 301 redirect for new subdomain

With default Nginx configuration generated by iRedMail installer, this issue should not happen.

- Nginx is configured to load virtual web host config files under /etc/nginx/sites-enabled/ in order. The default redirection is triggered by 00-default.conf, if the config file name for "naptar.mysite.com" does not start with "00-" or other characters which causes Nginx loads it before "00-default.conf", then your config file will be used first and no redirection triggered.

Questions:

- What's the config file name for this "naptar.mysite.com" host?
- Which directory under /etc/nginx/ do you store this config file?
- Did you modify any other Nginx config files under /etc/nginx/?