File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,7 @@ <h2><a name="5.Files-permissions"></a>5. Restricting files permissions</h2>
105105 account we authorize overrides through .htaccess, we need to set
106106 something that a .htaccess file cannot revert, and we need to set it
107107 for each of those directories. This can be done as follows inside
108- your VirtualHost definition in Apache (you'll have to translate it for
109- Nginx configurations), where "/var/www/URL/" is the path of your VirtualHost web root:< br />
108+ your VirtualHost definition in Apache, where "/var/www/URL/" is the path of your VirtualHost web root:< br />
110109 < pre >
111110 <Directory /var/www/URL/app/cache>
112111 php_admin_value engine Off
@@ -133,6 +132,25 @@ <h2><a name="5.Files-permissions"></a>5. Restricting files permissions</h2>
133132 php_admin_value engine Off
134133 </Directory>
135134 </ pre >
135+
136+ For Nginx, this would look like the following rules. However, do
137+ remember that Nginx interprets rules in order of appearance, so these
138+ rules would have to be at the top of your location rules to take the
139+ highest priority:
140+ < pre >
141+ location ~ ^/app/(cache|courses|home|logs|upload)/.*\.(php|php4|php5)$ {
142+ deny all;
143+ }
144+ location ~ ^/main/default_course_document/images/.*\.php$ {
145+ deny all;
146+ }
147+ location ~ ^/main/lang/.*\.php$ {
148+ deny all;
149+ }
150+ location ~ ^/web/css/.*\.php$ {
151+ deny all;
152+ }
153+ </ pre >
136154 < br />
137155< hr />
138156< h2 > < a name ="6.HSTS "> HTTP Headers Security</ a > </ h2 >
You can’t perform that action at this time.
0 commit comments