RewriteCond %{REQUEST_URI} how to in nginx?

Sorry if this is a dumb question, but a newb to nginx rewrites, been
trying to convert ALOT of websites over to nginx.

Though this one:

RewriteCond %{REQUEST_URI} !(index.php|.css) [NC]

How would this translate to nginx?

Probably doesn’t matter?

Joe

That is not a rewrite rule, it is a rewrite condition. The rule is the
first RewriteRule after the condition. Without the rule and all the
conditions that apply to it, you won’t be able to convert it.

On Fri, Nov 21, 2008 at 04:48:30PM -0600, Joe S. wrote:

Sorry if this is a dumb question, but a newb to nginx rewrites, been
trying to convert ALOT of websites over to nginx.

Though this one:

RewriteCond %{REQUEST_URI} !(index.php|.css) [NC]

How would this translate to nginx?

Probably doesn’t matter?

You should inverse RewriteCond logic (making it clear to human):

location / {
# !/(index.php|.css)

}

location ~ /index.php$ {

}

location ~ .css$ {

}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs