<html><body><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000"><div>I am having a difficult time finding a solution for this.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I have PHP applications that may be referenced to from several websites, either from root locations or sub locations.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>For example:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>server {<br data-mce-bogus="1"></div><div> server_name domain.com;<br data-mce-bogus="1"></div><div> location / {<br data-mce-bogus="1"></div><div> ... unrelated stuff ...<br data-mce-bogus="1"></div><div> }<br data-mce-bogus="1"></div><div> location /grant {<br> root /apps/grant/;<br> index index.php index.html;<br> try_files $uri $uri/ /grant/index.php?$args;<br><br> location ~ \.php$ {<br> include fastcgi_params;<br> fastcgi_pass unix:/local/sockets/grant.sock;<br> }<br> }</div><div>}<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>and then it may be somewhere else like this:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><div>server {</div><div> server_name another-domain.com;</div><div><div> location / {</div><div> ... unrelated stuff ...</div><div> }</div></div><div> location /employ {<br> root /apps/grant/;<br> index index.php index.html;<br> try_files $uri $uri/ /employ/index.php?$args;<br><br> location ~ \.php$ {<br> include fastcgi_params;<br> fastcgi_pass unix:/local/sockets/grant.sock;<br> }<br> }</div><div>}</div><div><br data-mce-bogus="1"></div><div>So the only two things different are the "location" and "try_files". However, I know that "root" will append the URI to the path, so it will try /apps/grant/grant/ and /apps/grant/employ/ when looking for files. When I use "alias", it seems that try_files tries looking for index.php in the context of "location /" on each.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>The only way I can seem to resolve this is by creating a symbolic link at /apps/grant/grant/ and /apps/grant/employ/ pointing back to /apps/rant/, which I do not want. I just want each location in each server to see /apps/grant/ as the root, and for try_files to process the index.php file in the base of that location last.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I have Lua compiled in, so I'm not sure if there are any tricks I can do with that to get this to work. I'm not sure what I'm missing.<br data-mce-bogus="1"></div><div><br>Can someone provide some guidance?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div><div><br data-mce-bogus="1"></div></div></body></html>