# Mod\_aclr2

**URL:** <https://www.ruby-forum.com/t/mod-aclr2/215639>\
**Category:** NGINX\
**Created:** [January 11, 2012, 2:18pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639 "2012-01-11T14:18:21Z")\
**Posts on this page:** 7\
**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 11, 2012, 2:18pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/1 "2012-01-11T14:18:21Z")

</div>

Hello!

Ever wondered how to set up NGINX as a local proxy for Apache 2.x with  
minimum efforts?

Check out this module:

> **[GitHub - defanator/mod\_aclr2: Module for Apache 2.x which automates serving...](https://github.com/defanator/mod_aclr2)**
>
> Module for Apache 2.x which automates serving static content with NGINX local proxy - GitHub - defanator/mod\_aclr2: Module for Apache 2.x which automates serving static content with NGINX local proxy

Feedback is welcome!

---

<div class="post-metadata">

**Author:** ![Andrey\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andrey\_B](https://www.ruby-forum.com/u/Andrey_B)\
**Post date:** [January 11, 2012, 2:41pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/2 "2012-01-11T14:41:15Z")

</div>

Thank You Andrey.

Regards,  
Joe

---

<div class="post-metadata">

**Author:** ![Andrey\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andrey\_B](https://www.ruby-forum.com/u/Andrey_B)\
**Post date:** [January 11, 2012, 2:55pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/3 "2012-01-11T14:55:28Z")

</div>

On 11 Jan 2012 13h17 WET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello!
> 
> Ever wondered how to set up NGINX as a local proxy for Apache 2.x  
> with minimum efforts?

Nice work Andrey. Opens up Nginx as a possibility for shared hosting  
(keep using .htaccess) and voids any resistance people might have trying  
Nginx out. It’s sooo easy now 🙂

Thanks,  
— appa

---

<div class="post-metadata">

**Author:** ![Andrey\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andrey\_B](https://www.ruby-forum.com/u/Andrey_B)\
**Post date:** [January 11, 2012, 4:32pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/4 "2012-01-11T16:32:37Z")

</div>

Would you explain the main difference between using your module and  
using  
nginx as a reverse proxy and caching static content ?

Regards

M

---

<div class="post-metadata">

**Author:** ![Andrey\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andrey\_B](https://www.ruby-forum.com/u/Andrey_B)\
**Post date:** [January 12, 2012, 2:52pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/5 "2012-01-12T14:52:47Z")

</div>

use ramdisktmpfs

2012-1-122:09Andrey B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) д

---

<div class="post-metadata">

**Author:** ![Andrey\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andrey\_B](https://www.ruby-forum.com/u/Andrey_B)\
**Post date:** [January 11, 2012, 7:10pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/6 "2012-01-11T19:10:07Z")

</div>

Martin,

On Jan 11, 2012, at 7:31 PM, Martin Loy wrote:

> Would you explain the main difference between using your module and using nginx  
> as a reverse proxy and caching static content ?

In some situations, mod\_aclr2 helps to avoid excessive disk I/O,  
especially for big static responses.

When nginx is used as a local reverse proxy and proxy\_buffering is  
enabled, every upstream reponse which can not fit into proxy buffers  
may be temporarily saved on disk:

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_path)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

For example, we have to process the request for 700mb video file,  
without mod\_aclr2:

1. nginx sends the request to apache
2. apache sends 700mb file back to nginx
3. nginx saves received file on disk (proxy\_temp\_path) and  
starts sending it back to the client

and with mod\_aclr2:

1. nginx sends the request to apache
2. apache sends a few bytes header with X-Accel-Redirect back to nginx
3. nginx starts sending the file directly from disk

You save your time and your disk at step #2.

Of course, you also may use proxy\_cache along with mod\_aclr2,  
but if your disks are fast enough, probably you won’t need  
to do any caching at all.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Andrey\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@Andrey\_B](https://www.ruby-forum.com/u/Andrey_B)\
**Post date:** [January 13, 2012, 1:55pm UTC](https://www.ruby-forum.com/t/mod-aclr2/215639/7 "2012-01-13T13:55:42Z")

</div>

Andrey

thanks for your response and great nice work!!

Regards

M
