1

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.

  • 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? – hdanniel 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)? –  May 04 '10 at 10:47

1 Answers1

0

The second location should be:

  location ~ \/build { 
          auth_basic off;
          proxy_pass http://hudson/;
  }