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 am trying to setup an Apache2 reverse proxy from my laptop (Windows 7, Apache 2.2.17) to a Nexus server (Windows Server 2003) on our network. This is just a test before setting this up for real on an Internet-visible server that we have. I can get the proxy itself setup and proxying Nexus beautifully. But when I try to apply authentication to the proxy, that's when things go wrong. I want to listen on port 8090.

Here are the relevant bits from my httpd.conf file:


Listen 8090

ProxyRequests Off
ProxyPreserveHost On

<Proxy /nexus>
    Order deny,allow
    Allow from all
</Proxy>

<Location /nexus>
    Order deny,allow
    Allow from all

    ProxyPass http://secret.mydomain.com:8082/nexus
    ProxyPassReverse http://secret.mydomain.com:8082/nexus

    AuthType Basic
    AuthName "Nexus"
    AuthBasicProvider file
    AuthUserFile c:\tmp\users

    Require valid-user
</Location>

If I comment out all the Auth* directives, the proxying to Nexus works a treat using a URL like http://localhost:8090/nexus/content/groups/central/ But once I add those Auth* directives back in, I get a login box, enter valid credentials, and then it prompts again. And again. And again. The one thing I noticed, is that the first time the credentials dialog appears, the realm shows up as "Nexus" (as I have it in httpd.conf). But on all subsequent prompts, it shows as "Sonatype Nexus Repository Manager," which, I assume, is coming from the Nexus server itself, even though it doesn't require authentication.

Also, I know that the password file and user/password are good, because if I setup authentication using them just for a local directory, it works fine.

I've found various blog posts about reverse proxies, and about authentication, but I just can't seem to make them work together. I've tried many things, but this is the problem distilled down to its simplest, I think.

Does anyone see anything blatantly wrong with my config? Or anything subtly wrong with it?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Your user auth is being passed to backend, you could try unsetting the authentication header with

RequestHeader unset Authorization

share|improve this answer
    
That's exactly what we ended up doing. A guy in my office figured it out every-so-slightly before you posted. :-) –  Joey Gibson Mar 7 '11 at 14:25

Your Answer

 
discard

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.