# Using Nginx as an injection proxy

**URL:** <https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102>\
**Category:** NGINX\
**Created:** [January 21, 2011, 5:46pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102 "2011-01-21T17:46:12Z")\
**Posts on this page:** 6\
**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:** [January 21, 2011, 5:46pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102/1 "2011-01-21T17:46:12Z")

</div>

Hi,

I’d like to know whether it is possible to use Nginx as an injection  
proxy (for 100% legal and professionnal use ! 🙂 ), notably to analyse  
the headers or content of a response, and perform automated changes on  
either or both the headers/content of the request, or change some parts  
of a request.

Practically, I want to do exactly the same kind of things that Fiddler 2  
allows to do : perform tests on header/content, and automatically make  
changes.

Bye,  
Yann

Posted at Nginx Forum:

> **[Using Nginx as an injection proxy](https://forum.nginx.org/read.php?2,168299,168299#msg-168299)**
>
> Hi, I'd like to know whether it is possible to use Nginx as an injection proxy (for 100% legal and professionnal use ! :) ), notably to analyse the headers or content of a response, and perform automated changes on either or both the headers/content...

---

<div class="post-metadata">

**Author:** ![yannlossouarn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/97f17d/32.png) [@yannlossouarn](https://www.ruby-forum.com/u/yannlossouarn)\
**Post date:** [February 14, 2011, 12:29pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102/2 "2011-02-14T12:29:36Z")

</div>

up 🙂

Posted at Nginx Forum:

> **[Re: Using Nginx as an injection proxy](https://forum.nginx.org/read.php?2,168299,174974#msg-174974)**
>
> Hi, I'd like to know whether it is possible to use Nginx as an injection proxy (for 100% legal and professionnal use ! :) ), notably to analyse the headers or content of a response, and perform automated changes on either or both the headers/content...

---

<div class="post-metadata">

**Author:** ![yannlossouarn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/97f17d/32.png) [@yannlossouarn](https://www.ruby-forum.com/u/yannlossouarn)\
**Post date:** [February 14, 2011, 1:41pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102/3 "2011-02-14T13:41:52Z")

</div>

On 21.01.2011, at 19:44, yannlossouarn wrote:

> Fiddler 2  
> allows to do : perform tests on header/content, and automatically make  
> changes.

It’s not possible.

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![yannlossouarn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/97f17d/32.png) [@yannlossouarn](https://www.ruby-forum.com/u/yannlossouarn)\
**Post date:** [February 14, 2011, 4:38pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102/4 "2011-02-14T16:38:05Z")

</div>

Hi Igor,

Oh I see : if you tel it’s not possible, I guess it is really not  
possible at all… ^^ Just for the sake of my mind, I’d be interested in  
complementary information : I was just studying nginx documentation, and  
had the feeling there may be something possible, by using simultaneously  
the rewrite, proxy and substitution modules. Where is the issue ? 😕

Bye and thanks for the great work !  
Yann

Posted at Nginx Forum:

> **[Re: Using Nginx as an injection proxy](https://forum.nginx.org/read.php?2,168299,175031#msg-175031)**
>
> Hi, I'd like to know whether it is possible to use Nginx as an injection proxy (for 100% legal and professionnal use ! :) ), notably to analyse the headers or content of a response, and perform automated changes on either or both the headers/content...

---

<div class="post-metadata">

**Author:** ![yannlossouarn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/97f17d/32.png) [@yannlossouarn](https://www.ruby-forum.com/u/yannlossouarn)\
**Post date:** [February 14, 2011, 5:51pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102/5 "2011-02-14T17:51:59Z")

</div>

@SplitIce : basically, I’d prefer to avoid using another language/module  
: I have not complete freedom over server setup. LUA is not installed on  
current setup, and I think sysadmins might be reluctant to installing  
the LUA module just for me. 😕

Would Rewrite+ Proxy + Substitution(s) make it, if I slightly modify my  
demand, so that I do not make “tests on header/content” before making  
changes. E.g., the aim would be to make requests on  
[http://mysubdomain.mydomain.net](http://mysubdomain.mydomain.net) get data on [http://somewhere.else.net](http://somewhere.else.net),  
changing the response body so that links to  
“[http://somewhere.else.net/foo.bar.html](http://somewhere.else.net/foo.bar.html)” are changed into  
“[http://mysubdomain.mydomain.net/tutu.html](http://mysubdomain.mydomain.net/tutu.html)”, plus other similar changes  
in the html source code ?

Thanks,  
Yann

Posted at Nginx Forum:

> **[Re: Using Nginx as an injection proxy](https://forum.nginx.org/read.php?2,168299,175061#msg-175061)**
>
> Hi, I'd like to know whether it is possible to use Nginx as an injection proxy (for 100% legal and professionnal use ! :) ), notably to analyse the headers or content of a response, and perform automated changes on either or both the headers/content...

---

<div class="post-metadata">

**Author:** ![yannlossouarn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/97f17d/32.png) [@yannlossouarn](https://www.ruby-forum.com/u/yannlossouarn)\
**Post date:** [February 14, 2011, 4:46pm UTC](https://www.ruby-forum.com/t/using-nginx-as-an-injection-proxy/202102/6 "2011-02-14T16:46:50Z")

</div>

You could do it using embedded perl or LUA probably.
