Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

so far,i am building AngularJS application served with nginx. I had rails in the middle and i came with rewrite ^/(?!assets) / last; rewrite rule (rewrite everything expect those beginning with assets), so far it was working - with rails:

   server {
      listen 80;
      server_name ies.local;
      root /home/jk/Projects/ies12/webapp/public;   # <--- be sure to point to 'public'!
      passenger_enabled on;
      rails_env development;
      rewrite ^/(?!assets) / last;
    }

But by today, i left rails and i need to extend this rule..

If I do something like

server {
  listen 80;
  server_name webapp.local;
  root /home/jk/Projects/webapp;
  rewrite_log on;

  rewrite ^/(?!angular) / last;
  rewrite ^/(?!angular-ui) / last;
}

having webapp/index.html only file and getting:

*1 rewrite or internal redirection cycle while internally redirecting to 
"/index.html", client: 127.0.0.1, server: webapp.local, request: "GET / HTTP/1.1", host: "webapp.local"
share|improve this question
    
Maybe merge it in one rule: rewrite ^/(\?!angular(-ui){0,1}) / last; –  emka86 Jan 23 '13 at 7:12
    
yeah, sure yours regexp will work. But finally i broke it. Mainly i had to rewrite ^/(?!angular) /index.html last; and my bad was <script src="angular" instead of <script src="/angular" in my files and i think this somehow caused the cycle.. –  Jakub Kuchar Jan 23 '13 at 8:18

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.