# SSI forwards request method

**URL:** <https://www.ruby-forum.com/t/ssi-forwards-request-method/125407>\
**Category:** NGINX\
**Created:** [January 8, 2008, 9:58pm UTC](https://www.ruby-forum.com/t/ssi-forwards-request-method/125407 "2008-01-08T21:58:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larrytheliquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/fbc32d/32.png) [@Larrytheliquid](https://www.ruby-forum.com/u/Larrytheliquid)\
**Post date:** [January 8, 2008, 9:58pm UTC](https://www.ruby-forum.com/t/ssi-forwards-request-method/125407/1 "2008-01-08T21:58:40Z")

</div>

I’ve noticed that when using server side includes, the original  
document’s  
request method is used for the includes of the subsequent documents.  
I would think that includes should be GET requests, regardless of the  
original document’s request method (you can’t add POST or PUT variables  
in  
the include statements, after all.)  
Should that be changed to always use GET?

Regardless, is it possible to change the request method from the Nginx  
side?

Redefining $request\_method as follows seems to be disallowed:

set $request\_method GET;

# Compile message:

# 2008/01/08 15:05:48 [emerg] 32758#0: the duplicate “request\_method”

variable in /usr/local/nginx/conf/nginx.conf:159

---

<div class="post-metadata">

**Author:** ![Larrytheliquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/fbc32d/32.png) [@Larrytheliquid](https://www.ruby-forum.com/u/Larrytheliquid)\
**Post date:** [January 8, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/ssi-forwards-request-method/125407/2 "2008-01-08T22:12:09Z")

</div>

On Tue, Jan 08, 2008 at 03:50:07PM -0500, Larrytheliquid wrote:

> set $request\_method GET;
> 
> # Compile message:
> 
> # 2008/01/08 15:05:48 [emerg] 32758#0: the duplicate “request\_method”
> 
> variable in /usr/local/nginx/conf/nginx.conf:159

nginx uses GET in subrequests, however, this functionality is not  
complete.  
The atached patch should fix the bug.

---

<div class="post-metadata">

**Author:** ![Larrytheliquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/fbc32d/32.png) [@Larrytheliquid](https://www.ruby-forum.com/u/Larrytheliquid)\
**Post date:** [January 9, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/ssi-forwards-request-method/125407/3 "2008-01-09T16:21:03Z")

</div>

Thank you Igor. Which version is that patch targeted at?

I tried 0.5.35 and it wouldn’t accept the patch:  
/usr/local/src/nginx-0.5.34 # patch -p0 \< /root/patch-subrequest  
patching file src/http/ngx\_http\_core\_module.c  
Hunk #1 FAILED at 113.  
Hunk #2 succeeded at 1427 (offset -336 lines).  
1 out of 2 hunks FAILED – saving rejects to file  
src/http/ngx\_http\_core\_module.c.rej

0.6.25 accepted the patch I but got compile errors:  
cc1: warnings being treated as errors  
src/http/ngx\_http\_core\_module.c:116: warning: pointer targets in  
initialization differ in signedness  
make[1]: \*\*\* [objs/src/http/ngx\_http\_core\_module.o] Error 1  
make[1]: Leaving directory `/usr/local/src/nginx-0.6.25’  
make: \*\*\* [build] Error 2

---

<div class="post-metadata">

**Author:** ![Larrytheliquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/fbc32d/32.png) [@Larrytheliquid](https://www.ruby-forum.com/u/Larrytheliquid)\
**Post date:** [January 9, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/ssi-forwards-request-method/125407/4 "2008-01-09T16:32:11Z")

</div>

On Wed, Jan 09, 2008 at 10:07:11AM -0500, Larrytheliquid wrote:

> Thank you Igor. Which version is that patch targeted at?
> 
> I tried 0.5.35 and it wouldn’t accept the patch:  
> /usr/local/src/nginx-0.5.34 # patch -p0 \< /root/patch-subrequest  
> patching file src/http/ngx\_http\_core\_module.c  
> Hunk #1 FAILED at 113.  
> Hunk #2 succeeded at 1427 (offset -336 lines).  
> 1 out of 2 hunks FAILED – saving rejects to file  
> src/http/ngx\_http\_core\_module.c.rej

The attached patch is against 0.5.35.

> 0.6.25 accepted the patch I but got compile errors:  
> cc1: warnings being treated as errors  
> src/http/ngx\_http\_core\_module.c:116: warning: pointer targets in  
> initialization differ in signedness  
> make[1]: \*\*\* [objs/src/http/ngx\_http\_core\_module.o] Error 1  
> make[1]: Leaving directory `/usr/local/src/nginx-0.6.25’  
> make: \*\*\* [build] Error 2

I did not test it under gcc 4.2. It should be

-static ngx\_str\_t ngx\_http\_core\_get\_method = { 3, "GET " };  
+static ngx\_str\_t ngx\_http\_core\_get\_method = { 3, (u\_char \*) "GET " };
