# Perl interaction with HTTP Proxy:

**URL:** <https://www.ruby-forum.com/t/perl-interaction-with-http-proxy/216606>\
**Category:** NGINX\
**Created:** [February 9, 2012, 9:31am UTC](https://www.ruby-forum.com/t/perl-interaction-with-http-proxy/216606 "2012-02-09T09:31:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 9, 2012, 9:31am UTC](https://www.ruby-forum.com/t/perl-interaction-with-http-proxy/216606/1 "2012-02-09T09:31:33Z")

</div>

Hey guys, I’m trying to write a couple of perl modules for my nginx  
server that is acting as an HTTP Proxy.

What I’d like to do is use Perl to perform some (quick) checks and  
then return an error code, but I’m noticing that if I execute any perl  
code before the config block that engages the http\_proxy, the perl  
error code is ignored. If I execute the perl block after the  
http\_proxy, then the connection isn’t proxy passed at all. Is this a  
config issue on my part or is this normal behavior with regards to  
perl. If it’s normal behavior, how can I use perl modules to perform  
checks with http\_proxy features enabled?

/Engin

---

<div class="post-metadata">

**Author:** ![Engin\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b9e5f3/32.png) [@Engin\_A](https://www.ruby-forum.com/u/Engin_A)\
**Post date:** [February 9, 2012, 9:38am UTC](https://www.ruby-forum.com/t/perl-interaction-with-http-proxy/216606/2 "2012-02-09T09:38:22Z")

</div>

Hello!

On Thu, Feb 09, 2012 at 02:30:36AM -0600, Engin A. wrote:

> checks with http\_proxy features enabled?  
> Both perl and proxy set exclusive location handlers, and they  
> can’t be used together in the same location.

If you need to check requests with perl and then proxy\_pass  
somewhere, you have to use $r-\>internal\_redirect(uri) in perl to  
pass processing to another location with proxy\_pass configured.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Engin\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b9e5f3/32.png) [@Engin\_A](https://www.ruby-forum.com/u/Engin_A)\
**Post date:** [February 9, 2012, 9:40am UTC](https://www.ruby-forum.com/t/perl-interaction-with-http-proxy/216606/3 "2012-02-09T09:40:51Z")

</div>

Awesome! Thank you. Going to experiment for a few more hours with this.

/Engin
