Welcome! Log In Create A New Profile

Advanced

Re: Proxy/caching with Apache and index.html files

August 11, 2010 02:42PM
On Tue, Aug 10, 2010 at 10:55:21AM -0400, MattWard wrote:

> Hi all,
>
> I've got an nginx frontend/apache backend setup with nginx using
> proxy_pass to pass requests for location / to my Apache server on
> localhost:8080. I've got a location setup to catch css/js/images/html
> etc. and serve them statically via nginx (fairly standard I believe).
>
> My question is, this works for everything (including html files, which I
> want served statically via nginx) apart from default index.html files
> that are matched by /. If I were to go to domain.com/index.html for
> example, this would be served by nginx, but if I go to domain.com/ and
> the default file is an index.html file I want it served by nginx (as
> opposed to a default index.php file which would still be passed through
> to Apache). What config do I need to get nginx to recognise this special
> case?

With the following configuration nginx will pass *.php requests to Apache:

location / {
index index.html index.php;
root /path/to/files;
}

location ~ \.php$ {
proxy_pass http://lcoalhost:8080;
}

/dir/ > /dir/index.php case will be handled via internal redirect,
please, look this:
http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy/caching with Apache and index.html files

MattWard August 10, 2010 10:55AM

Re: Proxy/caching with Apache and index.html files

Dayo August 11, 2010 03:26AM

Re: Proxy/caching with Apache and index.html files

MattWard August 11, 2010 07:42AM

Re: Proxy/caching with Apache and index.html files

Igor Sysoev August 11, 2010 02:42PM

Re: Proxy/caching with Apache and index.html files

MattWard August 12, 2010 06:13AM

Re: Proxy/caching with Apache and index.html files

Dayo August 15, 2010 03:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready