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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D5c07906b49ea820a8a21161173add0b?d=identicon&s=25 Nginx Forum (Guest)
on 2009-03-14 15:33
(Received via mailing list)
From "how to use variable in sub_filter and SSI?" at
http://forum.nginx.org/showthread.php?t=12

***************
I'm a newbie to nginx.

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

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

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

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

HTML:
---------
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.