nginx regex help needed
my site's theme has embedded PHP within some of its CSS files, to define colours/dimensions etc [for ease of making global changes]. under apache, i had set PHP to handle these CSS files by putting the following in an .htaccess file in the theme directory:
AddHandler application/x-httpd-php .css
php_value default_mimetype "text/css"
now, obviously the PHP inside these CSS files is no longer being parsed with the new nginx setup, so that the site layout is all over the show. what i need to do is tell nginx to hand over any CSS files it finds within /sites/
can some regex guru give me a few pointers?
2 Replies
location ~* /sites/
{
//stuff to pass to php-fastcgi
}
It basically means all files in the sites/
If you want all .css files to be passed to php which is what AddHandler will have done in apache use
location ~* .css
{
//stuff to pass to php
}
unfortunately it didnae work. drupal is still ignoring the CSS file with the PHP embedded in it.
for now, i've just gone through and removed all the PHP conditionals from the CSS file and hardwired everything in instead - and it's working fine now