# Enabling SSI when using a proxy

**URL:** <https://www.ruby-forum.com/t/enabling-ssi-when-using-a-proxy/177452>\
**Category:** NGINX\
**Created:** [October 17, 2009, 3:32pm UTC](https://www.ruby-forum.com/t/enabling-ssi-when-using-a-proxy/177452 "2009-10-17T15:32:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FranSSSSois\_Battail](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@FranSSSSois\_Battail](https://www.ruby-forum.com/u/FranSSSSois_Battail)\
**Post date:** [October 17, 2009, 3:32pm UTC](https://www.ruby-forum.com/t/enabling-ssi-when-using-a-proxy/177452/1 "2009-10-17T15:32:02Z")

</div>

Dear list,

I’ve troubles for having SSI working with proxy\_pass, when I use FastCGI  
it works fine. I believe I’ve made a mistake but so far it’s a mistery  
for me!

The PHP code proxied looks like this:

\<?php echo '' ; ?\>

and the site configuration like this:

# nginx 0.8.20

upstream apache  
{  
server 127.0.0.1:8080 ;  
}

server  
{  
listen 80 ;  
server\_name localhost ;  
ssi on ;

access\_log /var/log/nginx/localhost.access.log ;

location /  
{  
ssi on ;  
root /home/fb/www ;  
location /ssi  
{  
internal ;  
}  
}

error\_page 404 @php ;  
error\_page 403 @php ; # for the main page eg: “/”

# proxy the PHP scripts to Apache listening on :8080

location @php  
{  
rewrite ^(.\*)$ /index.php?$1 break ;  
proxy\_set\_header X-Real-IP $remote\_addr ;  
proxy\_redirect off ;  
ssi on ;  
proxy\_pass [http://apache](http://apache) ;  
}  
}

The SSI directive is not processed by Nginx when the upstream reply (it  
appears as an html comment).

Does anyone have a clue?

Best regards

---

<div class="post-metadata">

**Author:** ![FranSSSSois\_Battail](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/8e8cbc/32.png) [@FranSSSSois\_Battail](https://www.ruby-forum.com/u/FranSSSSois_Battail)\
**Post date:** [October 17, 2009, 5:40pm UTC](https://www.ruby-forum.com/t/enabling-ssi-when-using-a-proxy/177452/2 "2009-10-17T17:40:13Z")

</div>

Le samedi 17 octobre 2009 Ã 13:36 +0200, FranÃ§ois Battail a Ã©crit :

> I’ve troubles for having SSI working with proxy\_pass, when I use FastCGI  
> it works fine.

Found what’s happening! In Apache mod\_deflate was activated, just set it  
to off and it works fine.

Best regards
