Forum: NGINX How to... - how to use variable in sub_filter and SSI?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nginx Forum (Guest)
on 2009-03-14 16:33
(Received via mailing list)
From "how to use variable in sub_filter and SSI?" at

I'm a newbie to nginx.

I want to use a cookie varaible to change a string in html body.

          set $path "";
          if ($http_cookie ~ "path=([^;]+)(?:;|$)") {
               set  $path  $1;
          sub_filter pp $path;

         <!--#include file="/static/pp/test.html" -->

It can work with static string such as abc. But when I change it to a
variable,it output errors:

unexpected "abc" symbol after "/static/" value of "file" parameter in
"include" SSI command while sending response to client...
Does there anyone know how to use it?

Thanks in advance!

Posted by newbie
This topic is locked and can not be replied to.