Thanks for your help, but I couldn´t managed to work.
First, I checked my /etc/hosts file. It works fine with apache. (Why I don´t use apache instead of ngins if it works? Because Iredmail has installed by default nginx and I couldn´t reproduce it in apache to work as fine as it does in nginx. So I had to change and start learning Nginx, that is good for me, despite this problem)
Then, I removed all my /sites-enabled .conf files.
After I used this default.conf file you gave me.
It still goes to mysite.com/mail.
So, I modified the independent .conf files for each virtualhost to match your advice. Nothing, again, not only redirecting to /mail folder.
So, I have:
mysite.com -> redirecting to mysite.com/mail // I don´t have a mail folder, then I thought "I´ll have to make a /mail dir and put my main site there. I did and it redirects and redirects and never stops to show my demo files on there.
Now, like in the begining:
I have:
mysite.com -> redirecting again to mysite.com/mail and 404 not found error.
mail.mysite.com -> ok going to its subdomain name
wordpress.mysite.com --> ok going to its subdomain name
I guess, only guess:
There´s some kind of pre-config that iredmail do with nginx to make this happen and this hasn´t to do with templates or .conf files.
Thanls again in advance
danonanon wrote:luismsanchez wrote:I have same problem. Despite I configured 00-deafult.conf with miysite.com; domain name it still goes to mysite.com/mail
I'm using debian10 and nginx.
Iredmail added its own templates to my 00-default-ssl.conf , so I changed the include parameter from /etc/nginx/templates/roundcube.tmpl to roundcube-subdomain.tmpl file
That made possible to access to my desired mymail.mysite.com subdomain name to access roundcube, but still my main server virtualhost points mysite.com directly to mysite.com/mail
So, I modified roundcube-subdomain.tmpl file changing the location / parameter to another like /mymail . That made this:
- Point mysite.com to /mail but this time a 404 not found error
- point mysite.com/mail to my /var/www/html principal site.
Thanks in advance for your help
I hope I can help you.
If you set SSL serttificate, then change 00-default-ssl.conf, if you didn't set SSL sert, then change 00-default.conf
For example. I have iRedmail and vanilla forum. I maybe have iRedMail and your wordpress site
THIS IS FOR 00-defaul.conf, you if installed SSL, then change 00-default-ssl.conf and instead of 80 port it should be 443!
#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
# Listen on ipv4
listen 80;
listen [::]:80;
server_name mymail.yoursite.ru;
# Redirect all insecure http:// requests to https://
return 301 https://$host$request_uri;
}
server {
listen 80;
server_name yoursite.ru www.yoursite.ru;
root /var/www/;
index index.php;
}
server {
server_name www.yoursite.ru;
return 301 $scheme://yoursite.ru$request_uri;
}
So you see, the first server { is for your iRedmail. The second server { is for your website (wordpress), just don't forget ot change the path if it's not defaul (root /var/www/ maybe it's root /var/www/html/ on your side). The third server { is for make work www.yourdomain.ru and to redirect to yourdomain.ru
Also don't forget to change /etc/hosts
It should be something like that
127.0.0.1 mymail.yoursite.ru localhost
Make a reboot