Forum: NGINX figured out javascript, now just $_POST issue remaining

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris Cortese (Guest)
on 2009-03-01 15:21
(Received via mailing list)
I fixed the javascript problem.  Now I understand that only one
"location" directive can be hit.  So in the following case:

location ~* (jpg|jpeg|gif|png|js|css) {
      expires    30d;
      access_log off;
  }


 location /javascript/ {
     rewrite ^/javascript/(.*)$ /combine.php?type=javascript&files=$1
last;
  }

when requesting /javascript/prototype.js,scriptaculous.js ...  the
latter piece was not getting hit.

the only thing (I think) that's left is getting the $_POST array to post
through, as it does not work with simply:

  location / {
     error_page  404 = /index.php?q=$request_uri;
  }

and the patch I found out there, as I think I said before, sounds like
it conflicts with the latest nginx code.
Igor S. (Guest)
on 2009-03-01 18:15
(Received via mailing list)
On Sun, Mar 01, 2009 at 05:10:09AM -0800, Chris Cortese wrote:

>     rewrite ^/javascript/(.*)$ /combine.php?type=javascript&files=$1 last;
>  }
>
> when requesting /javascript/prototype.js,scriptaculous.js ...  the latter
> piece was not getting hit.

- location /javascript/ {
+ location ^~ /javascript/ {

> the only thing (I think) that's left is getting the $_POST array to post
> through, as it does not work with simply:
>
>  location / {
>     error_page  404 = /index.php?q=$request_uri;
>  }
>
> and the patch I found out there, as I think I said before, sounds like it
> conflicts with the latest nginx code.

The patch was commited:

Changes with nginx 0.7.11                                        18 Aug
2008

Changes with nginx 0.6.33                                        20 Nov
2008

    *) Feature: now nginx returns the 405 status code for POST method
       requesting a static file only if the file exists.
This topic is locked and can not be replied to.