# Nginx for pops/imaps

**URL:** <https://www.ruby-forum.com/t/nginx-for-pops-imaps/164522>\
**Category:** NGINX\
**Created:** [April 2, 2009, 7:49am UTC](https://www.ruby-forum.com/t/nginx-for-pops-imaps/164522 "2009-04-02T07:49:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![derwyn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@derwyn](https://www.ruby-forum.com/u/derwyn)\
**Post date:** [April 2, 2009, 7:49am UTC](https://www.ruby-forum.com/t/nginx-for-pops-imaps/164522/1 "2009-04-02T07:49:46Z")

</div>

Hi,

I managed to set up nginx to use as a imap/pop proxy with ssl.

I’ve found on the site the code in php to authenticate the users for  
imap/pop.  
The php script on the server sees the user and password as  
HTTP\_AUTH\_USER  
HTTP\_AUTH\_PASS  
HTTP\_AUTH\_PROTOCOL

Is it also possible to get the port that the user is connection to ie  
110,143 or 993,995 with some HTTP\_AUTH\_ variable or any other variable.  
Cause the HTTP\_AUTH\_PROTOCOL will shows up as pop/imap and not  
pops/imaps as desired.

I can see it in the logs which port the user is connected to eg. 110 or  
any other port and then redirect accordingly.

2009/03/27 17:08:03 [info] 16730#0: \*1 proxied session done, client:  
192.168.50.85, server: 0.0.0.0:110, login: “user1”, upstream:  
127.0.0.1:1100

Thanks & Regards,

Derwyn

---

<div class="post-metadata">

**Author:** ![derwyn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@derwyn](https://www.ruby-forum.com/u/derwyn)\
**Post date:** [April 2, 2009, 7:59am UTC](https://www.ruby-forum.com/t/nginx-for-pops-imaps/164522/2 "2009-04-02T07:59:08Z")

</div>

On Thu, Apr 02, 2009 at 10:57:17AM +0530, derwyn wrote:

> Is it also possible to get the port that the user is connection to ie  
> 110,143 or 993,995 with some HTTP\_AUTH\_ variable or any other variable.  
> Cause the HTTP\_AUTH\_PROTOCOL will shows up as pop/imap and not  
> pops/imaps as desired.
> 
> I can see it in the logs which port the user is connected to eg. 110 or  
> any other port and then redirect accordingly.
> 
> 2009/03/27 17:08:03 [info] 16730#0: \*1 proxied session done, client:  
> 192.168.50.85, server: 0.0.0.0:110, login: “user1”, upstream: 127.0.0.1:1100

> **['Re: Port access' - MARC](https://marc.info/?l=nginx&m=123815296329505&w=2)**
