Forum: NGINX nginx rewrite

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.
C2582289760ac1c443711b20e53f1d06?d=identicon&s=25 Paul Greenwood (Guest)
on 2009-02-15 22:02
(Received via mailing list)
How would you use regx in nginx for this:

RewriteCond %{QUERY_STRING} ^$ [OR] %{REQUEST_URI} ^/Special:Search
RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA,NE]

I'm not sure to how to do this?

Thanks For the Help
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-02-16 10:05
(Received via mailing list)
On Sun, Feb 15, 2009 at 01:52:19PM -0700, Paul Greenwood wrote:

> How would you use regx in nginx for this:
>
> RewriteCond %{QUERY_STRING} ^$ [OR] %{REQUEST_URI} ^/Special:Search
> RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA,NE]
>
> I'm not sure to how to do this?

   location / {
       if ($args = "") {
           rewrite  ^  /index.php?title=$request_uri?   last;
       }
   }

   location /Special:Search {
       rewrite  ^  /index.php?title=$request_uri?;
   }
C2582289760ac1c443711b20e53f1d06?d=identicon&s=25 Paul Greenwood (Guest)
on 2009-02-16 16:47
(Received via mailing list)
Thank You
C2582289760ac1c443711b20e53f1d06?d=identicon&s=25 Paul Greenwood (Guest)
on 2009-02-17 20:07
(Received via mailing list)
I'm sorry I am new to nginx but what does value $args hold and where
does
the value come from?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-02-17 20:34
(Received via mailing list)
On Tue, Feb 17, 2009 at 11:59:17AM -0700, Paul Greenwood wrote:

> I'm sorry I am new to nginx but what does value $args hold and where does
> the value come from?

$args is the same as $query_string.
561c2fb6d0c72e0c7bc52b263c7d56c3?d=identicon&s=25 Merlin (Guest)
on 2009-02-17 23:10
(Received via mailing list)
See http://wiki.codemongers.com/NginxHttpCoreModule#var_args or the
original
docs http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html (not
sure if
there is an anchor) which often autotranslate fairly readably if
something
is missing or out of date in the wiki.
This topic is locked and can not be replied to.