Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have Hudson running and made available to the world via nginx. I have protected Hudson with nginx's auth_basic and that works great. The trouble is, I want to allow unauthenticated requests to the build URL, i.e. /job/<job_name>/build.

Currently I have this in my nginx conf:

upstream hudson {
    server 127.0.0.1:8888;
}

server {
      server_name     ci.myurl.com;
      root            /var/lib/hudson;

      location / {
              proxy_pass http://hudson/;

              auth_basic "Super secret stuff";
              auth_basic_user_file /var/opt/hudson/htpasswd;

      }

      location ~ \/build { 
              auth_basic off;
      }       
  }

I can't get that second location to allow unauthenticated requests. I have tried various combinations of

location ~ /job/(.*)/biuld { }

location ^~ \/build { }

location ~ \/job\/(.*)\/build { }

etc...

Maddening!

Can anyone point me in the right direction?

Thanks,

Ad.

share|improve this question
    
I try the same configuration in nginx 0.8 and it works fine: everything with the "build" string is passing without authentication. What happens when you deactivate "/" location? Is the build url working? –  HD. Apr 30 '10 at 17:35
    
So I was doing a little digging and now I think this might be a permissions thing - have you chmod-ed you Hudson build dir (or anything similar)? –  rodreegez May 4 '10 at 10:47
add comment

1 Answer

up vote 0 down vote accepted

The second location should be:

  location ~ \/build { 
          auth_basic off;
          proxy_pass http://hudson/;
  }       
share|improve this answer
add comment

Your Answer

 
discard

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