I have a server running Nginx that is currently proxying all PHP script to Apache with the following location directive:
location ~ \.php$ {
proxy_pass http://@apache;
}
I'd like to introduce a new location directive like:
location ~* ^/blog/(.*\.php)$ {
alias /opt/blog/public;
fastcgi_pass @phpfpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
But when I access http://example.com/blog/test.php I'm hitting Apache and not php-fpm. How can I make the new location directive take precedence over the Apache location?
0 Answers