I have two web servers nginx and apache2. I have an A record for mail.aboutryansam.com and a CNAME webmail.aboutryansam.com. I've been trying to setup a postfix and dovecot mail server hosted on mail.aboutryansam.com and a roundcube mail client hosted on webmail.aboutryansam.com. I'm runnig Ubuntu 18. I have two dir /var/www/nginx/mail.aboutryansam.com/ for the mail server. And I have /var/www/html for roundcube. By default apache2 and nginx run on the same port so I changed nginx to use port 81. I have the default html page in the apache dir and I made a custom one in my nginx dir. When I visit mail.aboutryansam.com it still takes me to the apache html page but I have the conf file to work off the nginx dir
server {
listen 81;
server_name mail.aboutryansam.com;
location {
root /var/www/nginx/mail.aboutryansam.com
index index.html index.htm;
# proxy_pass http://localhost:3010;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
}
}
I'm having lots of trouble running web servers and I'm new to server administration so sorry If I couldn't explain it well enough. If you can help me with and answer, please be "--verbose" as I said I'm new to this stuff.