flexjoly
Verified User
Hi,
Just testing the php=off feature for a domain. Knowing that nginx does not parse php on its own, but will expose the source-file.
If php is off for a user or domain, then nginx should disable any php/inc-file. So your source code is not shown by accident.
For now I added/changed the following in nginx_server[_secure].conf
This works almost. But the internal redirect from http://domain.com without uri is still forwarded to index.php, and downloadable as source-file ??
---update--- after some other changes/rewrites this also is working and no php is exposed anymore.
At the moment I only copy/paste my old configs to the new server, and I forgot about all the different location settings.
As it was only for testing, I cannot dive into this now. But I hope DA will make a fix.
Thanks in advance
flexJoly
Just testing the php=off feature for a domain. Knowing that nginx does not parse php on its own, but will expose the source-file.
If php is off for a user or domain, then nginx should disable any php/inc-file. So your source code is not shown by accident.
For now I added/changed the following in nginx_server[_secure].conf
Code:
|*if PHP="ON"|
index index.php index.html index.htm;
|*endif|
|*if PHP!="ON"|
location ~ \.php$ {
return 404;
}
---update--- after some other changes/rewrites this also is working and no php is exposed anymore.
At the moment I only copy/paste my old configs to the new server, and I forgot about all the different location settings.
As it was only for testing, I cannot dive into this now. But I hope DA will make a fix.
Thanks in advance
flexJoly
Last edited: