Welcome! Log In Create A New Profile

Advanced

Setting up IMAP proxy balancer and SSL offloading

Posted by fran125 
Setting up IMAP proxy balancer and SSL offloading
January 12, 2016 04:19AM
Hi forum,

I need to setting up a Nginx server according to this two statements:

- IMAP proxy balancer.
- SSL offloading.

I have no problems with ssl offloading and proxy but it does not work when I add upstream section in order to get balanced traffic.

Is this possible? Or is not possible setting up with this two conditions?

Best regards.
Francisco
Re: Setting up IMAP proxy balancer and SSL offloading
January 12, 2016 04:49AM
Anything is possible, config? error logs?

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Setting up IMAP proxy balancer and SSL offloading
January 12, 2016 05:13AM
Nginx is installed on RH 6.5. This is my nginx.conf

-----------------------------
user nginx;
worker_processes 2;

pid /var/run/nginx.pid;
error_log /var/log/nginx/error.log;


events {
worker_connections 1024;
}

upstream backend1 {
server 10.108.20.8:143;
server 10.108.20.9:143;
}

upstream backend2 {
server 10.108.20.8:144;
server 10.108.20.9:144;
}

mail {
proxy on;

imap_capabilities "IMAP4rev1" "UIDPLUS"; ## default

server {
listen 10.108.101.226:143;
protocol imap;
auth_http backend1;
proxy on;
}

server {
listen 10.108.101.226:144;
protocol imap;
auth_http backend2;
proxy on;

}

server {
listen 10.108.101.226:993 ssl;
protocol imap;
auth_http backend1;
proxy on;

ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 SSLv3;
ssl_ciphers HIGH:!ADH:!MD5:@STRENGTH;
ssl_session_cache shared:TLSSL:16m;
ssl_session_timeout 10m;
## default SSL cert. Each host should have its own.
ssl_certificate ssl/XX.crt;
ssl_certificate_key ssl/XX.key;
}

server {
listen 10.108.101.227:994 ssl;
protocol imap;
auth_http backend2;
proxy on;

ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 SSLv3;
ssl_ciphers HIGH:!ADH:!MD5:@STRENGTH;
ssl_session_cache shared:TLSSL:16m;
ssl_session_timeout 10m;
## default SSL cert. Each host should have its own.
ssl_certificate ssl/XX.crt;
ssl_certificate_key ssl/XX.key;
}

}
-----------------------------
error.log output.

[emerg] 6028#0: "upstream" directive is not allowed here in /etc/nginx/nginx.conf

Regards.
Re: Setting up IMAP proxy balancer and SSL offloading
January 12, 2016 06:09AM
fran125 Wrote:
-------------------------------------------------------
> error.log output.
>
> [emerg] 6028#0: "upstream" directive is not allowed here in
> /etc/nginx/nginx.conf

Easy to find http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream
Look at your context area.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Setting up IMAP proxy balancer and SSL offloading
January 12, 2016 06:28AM
itpp2012 Wrote:
-------------------------------------------------------
> fran125 Wrote:
> -------------------------------------------------------
> > error.log output.
> >
> > [emerg] 6028#0: "upstream" directive is not allowed here in
> > /etc/nginx/nginx.conf
>
> Easy to find
> http://nginx.org/en/docs/http/ngx_http_upstream_module.html#upstream
> Look at your context area.

I looked that but seems that upstream only work with http context and not with mail context.

I got the same error if I insert upstream inside mail block.
Regards.
Re: Setting up IMAP proxy balancer and SSL offloading
January 12, 2016 08:14AM
Maybe this one
https://tipstricks.itmatrix.eu/tcp-load-balancing-for-email-servers-with-nginx/

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 194
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready