Hi all,
I would like to get a feedback for my Nginx configuration for supporting a mail server in FreeBSD. Currently I did setup the following to have my own mail server, but have a confusion on how to setup the server block in a non-premium Nginx (1.22.1) as I cannot use my mail client in my laptop to connect to SMTP.
1. DNS level: mail.example.com, NX: mail.example.com
2. Server level:
- Dovecot, Postfix, PostfixAdmin, with MySQL as storage.
- Got SSL certificate for mail.example.com and redirect port 80 to port 443 for mail.example.com.
- The server block for the Nginx is as following:
Now from my mail client, it seems it can't connect to the SMTP, while I check the service is running and the DNS seems to be ok. Additionally one server block is sufficient for both Dovecot and SMTP?
I would like to get a feedback for my Nginx configuration for supporting a mail server in FreeBSD. Currently I did setup the following to have my own mail server, but have a confusion on how to setup the server block in a non-premium Nginx (1.22.1) as I cannot use my mail client in my laptop to connect to SMTP.
1. DNS level: mail.example.com, NX: mail.example.com
2. Server level:
- Dovecot, Postfix, PostfixAdmin, with MySQL as storage.
- Got SSL certificate for mail.example.com and redirect port 80 to port 443 for mail.example.com.
- The server block for the Nginx is as following:
NGINX:
server {
listen 443 ssl;
server_name mail.example.com;
ssl_certificate ...
ssl_certificate_key ...
location / {
proxy_pass localhost:25;
proxy_set_header. Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Now from my mail client, it seems it can't connect to the SMTP, while I check the service is running and the DNS seems to be ok. Additionally one server block is sufficient for both Dovecot and SMTP?