Static index file in Nginx+Apache

location / {
index index.htm;
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location ~* .(jpg|jpeg|gif|png|ico|css|bmp|js|swf|html|htm)$ {
root /home/site/public_html/;
}

I need process the request “GET /” via Nginx (as static file).
Added directive “index” has no effect, the request passed to backend.
What’s wrong?

Thanks.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,221434,221434#msg-221434

On Thu, Jan 19, 2012 at 3:21 PM, ilin [email protected] wrote:

}

I need process the request “GET /” via Nginx (as static file).
Added directive “index” has no effect, the request passed to backend.
What’s wrong?

since “/” doesn’t match the latter part, just add this one location
block:

location = / { }


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Nginx responded 404

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,221434,221439#msg-221439

On Thu, Jan 19, 2012 at 4:40 PM, ilin [email protected] wrote:

Nginx responded 404

http://wiki.nginx.org/Pitfalls#Root_inside_Location_Block


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs