Enabling SSI when using a proxy

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 ;
}
}

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

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