[FORUM] How to... - how to use variable in sub_filter and SSI?

Nginx Forum forum.nginx.org at gmail.com
Sat Mar 14 17:22:43 MSK 2009


>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





More information about the nginx mailing list