MT6 webmail nginx

From The Network People, Inc. - Wiki
Jump to navigation Jump to search

install nginx

pkg install -y nginx \
&& mkdir -p /usr/local/etc/nginx/conf.d \
&& fetch -o /usr/local/etc/nginx/conf.d/mail-toaster.conf http://mail-toaster.com/install/mt6-webmail-nginx.txt
$EDITOR /usr/local/etc/nginx/nginx.conf

Replace the http.server.location / block with this line:

include conf.d/mail-toaster.conf;

install nginx with realip module

cat <<EONGINX >> /etc/make.conf
www_nginx_SET=HTTP_REALIP
EONGINX
make -C /usr/ports/www/nginx build deinstall install clean

start nginx

grep -q nginx_enable /etc/rc.conf || echo 'nginx_enable=YES' >> /etc/rc.conf
service nginx restart