Advertisement:

Author Topic: Osclass with Nginx only passes specific PHP files for execution  (Read 761 times)

Normalu

  • Newbie
  • *
  • Posts: 23
Is it possible to specify which PHP files are allowed to execute using Nginx coniguration as in: http://wiki.nginx.org/Pitfalls#Passing_Uncontrolled_Requests_to_PHP

It suggest using something like this:
Code: [Select]
location ~* (file_a|file_b|file_c)\.php$ {
  fastcgi_pass backend;
  ...
}

I see Oslcass has many PHP files in different folders. Is it possible to setup such security in a simple way or it would be too complicated with Osclacss?

Normalu

  • Newbie
  • *
  • Posts: 23
Re: Osclass with Nginx only passes specific PHP files for execution
« Reply #1 on: March 25, 2015, 03:35:41 pm »
That page also suggest this:
Specifically disable the execution of PHP files in any directory containing user uploads.

Code: [Select]
location /uploaddir {
  location ~ \.php$ {return 403;}
  ...
}

Could you please advise on applying this to /oc-content/uploads/ or any other folder?