After re-reading the documentation page (<a href="http://wiki.codemongers.com/NginxHttpCoreModule#var_request_uri">http://wiki.codemongers.com/NginxHttpCoreModule#var_request_uri</a>), it turns out that "$request_uri" is indeed supposed to be the original request:
<br>"<tt>$request_uri</tt>, this variable is equal to the complete initial URI together with the arguments;"<br><br>Is there a variable like "$request_uri" that applies to the current request?<br>If not, the alternative is an "if statement" that checks to see whether "$query_string" has a value. If it does, use $uri?$query_string, otherwise use $uri.
<br><br><div class="gmail_quote">On Nov 10, 2007 4:04 PM, Larrytheliquid <<a href="mailto:larrytheliquid@gmail.com">larrytheliquid@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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" target="_blank">
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><font color="#888888"><br>-- <br>Respectfully,<br>Larry Diehl<br><a href="http://www.larrytheliquid.com" target="_blank">www.larrytheliquid.com</a>
</font></blockquote></div><br><br clear="all"><br>-- <br>Respectfully,<br>Larry Diehl<br><a href="http://www.larrytheliquid.com">www.larrytheliquid.com</a>