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 &quot;root /Users/larry/Sites/ngingx_request_uri/html;&quot; 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&nbsp; 1;<br>events {<br>&nbsp;&nbsp;&nbsp; worker_connections&nbsp; 256;<br>}<br><br>http {<br>&nbsp;&nbsp;&nbsp; server {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen 8084;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location / {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssi on;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default_type text/html;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /Users/larry/Sites/ngingx_request_uri;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>
------------------------------------------------------<br>example.html<br>
------------------------------------------------------<br clear="all">&lt;html&gt;<br>&nbsp; &lt;head&gt;<br>&nbsp;&nbsp;&nbsp; &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;title&gt;$request_uri with SSI&lt;/title&gt;
<br>&nbsp; &lt;/head&gt;<br>&nbsp; &lt;body&gt;<br>&nbsp;&nbsp;&nbsp; &lt;h3&gt;From example.html&lt;/h3&gt;<br>&nbsp;&nbsp;&nbsp; &lt;p&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;strong&gt;$request_uri: &lt;/strong&gt;&lt;!--# echo var=&quot;request_uri&quot; --&gt; ::<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;strong&gt;$uri: &lt;/strong&gt;&lt;!--# echo var=&quot;uri&quot; --&gt; ::
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;strong&gt;$query_string: &lt;/strong&gt;&lt;!--# echo var=&quot;query_string&quot; --&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/p&gt;<br>&nbsp;&nbsp;&nbsp; &lt;!--# include virtual=&quot;/fragment.inc?page=1&quot; --&gt;<br>&nbsp; &lt;/body&gt;<br>&lt;/html&gt;
<br><br>
------------------------------------------------------<br>
fragment.inc<br>

------------------------------------------------------<br>&lt;h3&gt;From fragment.inc&lt;/h3&gt;<br>&lt;p&gt;<br>&nbsp; &lt;strong&gt;$request_uri: &lt;/strong&gt;&lt;em&gt;&lt;!--# echo var=&quot;request_uri&quot; --&gt;&lt;/em&gt; ::
<br>&nbsp; &lt;strong&gt;$uri: &lt;/strong&gt;&lt;!--# echo var=&quot;uri&quot; --&gt; ::<br>&nbsp; &lt;strong&gt;$query_string: &lt;/strong&gt;&lt;!--# echo var=&quot;query_string&quot; --&gt;&nbsp; <br>&lt;/p&gt;<br>&lt;p&gt;Shouldn&#39;t $request_uri be &quot;&lt;em&gt;/fragment.inc?page=1&lt;/em&gt;&quot;?&lt;/p&gt;
<br><br>-- <br>Respectfully,<br>Larry Diehl<br><a href="http://www.larrytheliquid.com">www.larrytheliquid.com</a>