0

I assumed that I could simply hardcode the SCRIPT_FILENAME but I keep getting "File not found." errors. This is what I have:

location =/wp-content/plugins/foo/analytics.js {
    fastcgi_pass localhost:9000;
    fastcgi_param SCRIPT_FILENAME /home/deploy/wordpress/wp-content/plugins/foo/analytics.js.php;
    include  fastcgi_params;
}

What's the proper way of doing this? I don't want to do a URL rewrite where I redirect from .js to .js.php. The file exists in the location specified in nginx.

1 Answer 1

0

Of course rewrite doesn't imply a redirect and is fine to use, silly sleep deprivation. This works:

location =/wp-content/plugins/foo/analytics.js {
    rewrite ^(.+)$ $1.php;
    fastcgi_pass localhost:9000;
    include  fastcgi_params;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .