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'm trying to use Nginx as reverse proxy with Apache to cache static files, etc. I'm having an issue on a new install, that it's not passing on URIs to Apache. Basically I have a vBulletin forum, and I'm using vBSEO as the SEO proxy. The problem is it's generating 404s for every URL, except files that already exist.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Could you possibly give us the relevant portion of your nginx configuration? A.t.m. we cannot guess what's wrong (although one might: using 'localhost' when not in the hosts file, so not resolving to 127.0.0.1, wrong portnumber for apache, forgetting to add a host header, etc.). Normally, It'd be something like:

server {
    listen       80;
    server_name  www.example.com;

    # normally some checking here for static content which exists as file 
    # like images, js, etc, with a 'break', with at the end:

    location / {
        proxy_pass         http://127.0.0.1:<portnumber apache is on>/;
        proxy_redirect     off;
        proxy_set_header   Host $host;
    }
}
share|improve this answer

Well I traced it down to the SEO friendly plugin ( vBSEO ). It was producing links with .html extension and it seems nginx had it set for caching. Since those links didn't exist physically, it was producing the 404s.

share|improve this answer
    
Ah, you do know you can let nginx check for the existance of a file and resort to proxying if not found? –  Wrikken Jun 15 '10 at 10:23
    
Well that was already added to the rules. The basic fact was that it was proxying all together because the extension was there. –  Adrian A. Jun 18 '10 at 1:58

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.