Apache nginx sets the directory without execution permission. web services include iis, apache, and nginx. The operating system is nothing more than windows or * nux.
The code is as follows: |
Copy code |
Location ~ ^/Upload/. *. (php Tutorial | php5) $ { Deny all; } |
We can see that the two segments usually have no permission for the upload Directory. The configuration is as follows:
The code is as follows: |
Copy code |
<Directory "/var/111cn.net/upload"> <Filesmatch ". php"> Order allow, deny Deny from all </Filesmatch> </Directory> |
* Nux is different. Everyone knows that * the nux operating system is case sensitive.
The code is as follows: |
Copy code |
<Directory "/var/www/upload"> <Filesmatch "(? I:. php) "> //? Is to match as many. php strings as possible, I is case-insensitive, followed by a colon followed by a regular expression Order allow, deny Deny from all </Filesmatch> </Directory> |
In addition, let's take a look at the nginx virtual host protection webshell perfect version.
Nginx. conf
The code is as follows: |
Copy code |
Server { Listen 80; Server_name www.a.com; Index index.html index.htm index. php; Root/data/htdocs/www.a.com /; # Limit_conn crawler 20; Location ~ . *. (Php | php5 )? $ { # Fastcgi_pass unix:/tmp/php-cgi.sock; Fastcgi_pass 127.0.0.1: 9000; Fastcgi_index index. php; Fcinclude GI. conf; } } Server { Listen 80; Server_name www. B .com; Index index.html index.htm index. php; Root/data/htdocs/www.111cn.net /; # Limit_conn crawler 20; Location ~ . *. (Php | php5 )? $ { # Fastcgi_pass unix:/tmp/php-cgi.sock; Fastcgi_pass 127.0.0.1: 9000; Fastcgi_index index. php; Fcinclude GI. conf; } } |