How to leverage HTTP upstream features

Charles Orth charles.orth at teamaol.com
Thu Jul 7 12:42:55 UTC 2016


Thanks Maxim,
The loopback feature you described is the work around we're using.
However, the new service I'm attempting to implement, it is costly on 
several fronts.
My impression of reimplementation of upstream was what I was suspecting 
all along.

Thanks


Maxim Dounin wrote:
> Hello!
>
> On Tue, Jul 05, 2016 at 05:00:03PM -0400, Charles Orth wrote:
>
>   
>> I'm new to nginx...
>> I would like to define upstream handler in HTTP without a HTTP server
>> listener. From SMTP/POP3/IMAP I would like
>> to use the upstream handler for my http endpoint. Thus requiring
>> http_upstream initialize, create a request, hand the request off to upstream
>> for processing and finally having HTTP upstream handler return the entire
>> response to my handler.
>> I haven't found any examples or patches where I can leverage HTTP upstream
>> from Mail service perspective.
>> Does anyone have a suggestion or an example?
>>     
>
> This is not something you can do.  Mail and http are different 
> modules, and you can't use http module features in the mail 
> module.  If you want to use upstreams in mail, you have to 
> reimplement them there.
>
> Practical solution is to use one address in mail (e.g., 
> 127.0.0.1:8080) and additionally balance requests using http 
> reverse proxy, e.g.:
>
> mail {
>     auth_http 127.0.0.1/mailauth;
>     ...
> }
>
> http {
>     upstream backends {
>         server 127.0.0.2:8080;
>         ...
>     }
>
>     server {
>         listen 8080;
>
>         location /mailauth {
>             proxy_pass http://backends;
>         }
>     }
> }
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160707/38677d31/attachment.html>


More information about the nginx mailing list