REST URLs and NGINX (config help needed)

Ben ben+nginx at
Thu Jun 16 13:06:50 UTC 2016

 >> If it helps, I'm using bramus router and my configured paths are as
 >> follows :
 > Looks like the logic for getting base path is a bit interesting. Try
 > this for related line:
 > fastcgi_param SCRIPT_NAME /demo/;

That didn't work unfortunatley.

Just dug up their code and I see what you mean !

I put their "implode('/', array_slice(explode('/', 
$_SERVER['SCRIPT_NAME']), 0, -1)) . '/';" into my PHP and

for /demo/ it prints "/demo/"
for /demo/hello/x it prints "/demo/hello"

Which looks like their "auto base-path" is setting moving goalposts !!

Any other alternative NGINX configs I could try ?  I've tried reporting 
their base path but they're not particularly interested in fixing it!

I have also tried :

try_files $uri $uri/ /demo/demo.php;

But that only seems to work intermittently (which I guess is why NGINX 
recommend the original method I posted !).

More information about the nginx mailing list