Configuring nginx as mail proxy

Maxim Dounin mdounin at mdounin.ru
Wed Oct 24 16:26:52 UTC 2012


Hello!

On Wed, Oct 24, 2012 at 11:49:43AM -0400, Laurent Bonetto wrote:

> Thanks. That was indeed my first issue. I did sudo port edit 
> nginx, added --with-mail to the config options, reinstalled, and 
> now I am passed that error.
> 
> I then got an error that no events was present so I just added 
> events {
>  worker_connections 1;
>  }

This isn't going to work.  With such a low number of worker 
connections nginx won't be able to start worker processes properly 
(unless you have no listening sockets configured).

Try looking into error log, you should see something like:

2012/10/24 20:17:53 [alert] 58202#0: 1 worker_connections are not enough
2012/10/24 20:17:53 [notice] 58201#0: signal 20 (SIGCHLD) received
2012/10/24 20:17:53 [notice] 58201#0: worker process 58202 exited with code 2
2012/10/24 20:17:53 [alert] 58201#0: worker process 58202 exited with fatal code 2 and cannot be respawned

You have to set worker_processes to something reasonable.  
Something like 512 as by default is usually a good choice for a 
small test server.

> Now nginx is starting but I never see any hit to my mock service 
> despite it being specified in auth_http
>     auth_http    http://localhost:8080/authorize;
> No errors reported in the error log.
> 
> When is nginx expected to hit the url specified in nginx? When 
> it gets launched? When an event occurs on the ports 110 and 2525 
> with the protocols I specified?

The auth service is requested when nginx needs to authenticate a 
client and to find out a backend server address to proxy the 
client to.

-- 
Maxim Dounin
http://nginx.com/support.html



More information about the nginx mailing list