When including a file with SSI that has a query string, the $uri and $query_string variables are set to the included file. However, the $request_uri variable remains set to the original file. Is this supposed to happen, or should $request_uri change?
<br><br>An example follows, just be sure to change "root /Users/larry/Sites/ngingx_request_uri/html;" to point to your local copy. Once you have created these files, go to <a href="http://127.0.0.1:8084/example.html?page=1">
http://127.0.0.1:8084/example.html?page=1</a><br><br>
------------------------------------------------------<br>nginx.conf<br>------------------------------------------------------<br>worker_processes 1;<br>events {<br> worker_connections 256;<br>}<br><br>http {<br> server {
<br> listen 8084;<br><br> location / {<br> ssi on;<br><br> default_type text/html;<br><br> root /Users/larry/Sites/ngingx_request_uri;<br> }<br> }<br>}<br><br><br>
------------------------------------------------------<br>example.html<br>
------------------------------------------------------<br clear="all"><html><br> <head><br> <meta http-equiv="Content-type" content="text/html; charset=utf-8"><br> <title>$request_uri with SSI</title>
<br> </head><br> <body><br> <h3>From example.html</h3><br> <p><br> <strong>$request_uri: </strong><!--# echo var="request_uri" --> ::<br> <strong>$uri: </strong><!--# echo var="uri" --> ::
<br> <strong>$query_string: </strong><!--# echo var="query_string" --><br> </p><br> <!--# include virtual="/fragment.inc?page=1" --><br> </body><br></html>
<br><br>
------------------------------------------------------<br>
fragment.inc<br>
------------------------------------------------------<br><h3>From fragment.inc</h3><br><p><br> <strong>$request_uri: </strong><em><!--# echo var="request_uri" --></em> ::
<br> <strong>$uri: </strong><!--# echo var="uri" --> ::<br> <strong>$query_string: </strong><!--# echo var="query_string" --> <br></p><br><p>Shouldn't $request_uri be "<em>/fragment.inc?page=1</em>"?</p>
<br><br>-- <br>Respectfully,<br>Larry Diehl<br><a href="http://www.larrytheliquid.com">www.larrytheliquid.com</a>