Welcome! Log In Create A New Profile

Advanced

Re: location ~ \.php$ does not work with proxy_pass breaks pretty permalinks

Igor Sysoev
December 02, 2009 05:28AM
X-Subject: Re: location ~ \.php$ does not work with proxy_pass breaks pretty
permalinks

On Wed, Dec 02, 2009 at 03:24:31AM -0500, nerdgrind wrote:

> I am using Nginx as a frontend server to server only static files, and apache as the backend server to serve only php file. I saw a configuration for proxy_pass that would allow me to be 100% sure I was only serving php files by using the expression~ \.php$. I saw this from a reply from Igor in http://forum.nginx.org/read.php?2,13955
>
> I am currently using:
>
> server ...
>
> location / {
> proxy_pass http://127.0.0.1:8008;
>
> location ~ \.(html|htm|xml|css|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
> root /var/www/mydomain;
> index index.php index.html index.htm;
>
> In the static location I can isolate what is served by Nginx to just the files listed, but in the proxy_pass location I can only use "/" so I can't be sure only php files are served by apache. I would like to use the following:
>
> location ~ \.php$ {
> proxy_pass http://127.0.0.1:8008;
>
> This works with fast_cgi, but not with proxy_pass.
>
> When I do use ~ \.php$ I can only see the homepage, but not the post pages, page2, or anything but the home page. I am using Wordpress with pretty permalinks. I also use WP Super Cache.
>
> How do I know I am only serving php files with Apache? Is there an expression I can use to force the location for proxy_pass to only serve php files without breaking my pretty permalinks?

How do these pretty permalink URLs look ?


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

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

location ~ \.php$ does not work with proxy_pass breaks pretty permalinks

nerdgrind December 02, 2009 03:24AM

Re: location ~ \.php$ does not work with proxy_pass breaks pretty permalinks

Igor Sysoev December 02, 2009 05:28AM

Re: location ~ \.php$ does not work with proxy_pass breaks pretty permalinks

nerdgrind December 02, 2009 10:50AM

Re: location ~ \.php$ does not work with proxy_pass breaks pretty permalinks

nerdgrind December 02, 2009 05:07PM

Re: location ~ \.php$ does not work with proxy_pass breaks pretty permalinks

nerdgrind December 02, 2009 11:03PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 196
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