Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following rewrite rule, used for WordPress Network to handle the file requests:

   location @rewrite {                                                     
            rewrite ^/(.*)$ /index.php?q=$uri&$args;                        
            rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last; 

I seems that running owncloud 3 on the same domain the dav requests are caught by this rule. Therefore I'd like to extend the line to only be applied of no owncloud word was found in the uri.

Can someone help me, please?

share|improve this question
up vote 0 down vote accepted

If you can write a more specific rule, then that's probably beneficial - you don't want to accidentally exempt locations that should be rewritten; is there a specific directory you can apply this to?

That said, you can definitely just exempt anything with owncloud; add this to the location block above the existing rewrite lines:

rewrite ^(.*owncloud.*)$ $1 last;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.