I've just created a layer4 nginx server, which is used as a load-balancer for a kubernetes cluster.
I know it is a very basic question (and probably I'll get a lot of downvotes for this), but is it possible to install and run a mail-server on the same machine? Is the mailserver traffic just running on different ports and therefore it shouldn't be a problem?
My nginx config looks like this:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
stream {
upstream http {
server 123.45.67.170:80;
server 123.45.67.171:80;
server 123.45.67.172:80;
}
upstream ssl {
server 123.45.67.170:443;
server 123.45.67.171:443;
server 123.45.67.172:443;
}
server {
listen 80;
proxy_pass http;
}
server {
listen 443;
proxy_pass ssl;
}
}
http {
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf;
}
and I think I have to add something like this:
mail {
server_name mail.test.com;
auth_http http://127.0.0.1:8000;
xclient off;
server {
listen 3333;
protocol smtp;
smtp_auth none;
}
}
But if this is correct, should I install the mailserver on this machine itself or should I use a mailserver, which is running in the k8s cluster?