Nginx anti-theft chain nginx access control Nginx parsing PHP-related configuration Nginx agent

Source: Internet
Author: User
Tags curl fpm

12.13 Nginx anti-theft chain

Cd/usr/local/nginx/conf/vhost
VI test.com.conf
Copy the above content to a location

Test, success
Premise data/wwwroot/test.com directory to have 1.gif

12.14 Nginx Access Control

Cd/usr/local/nginx/conf/vhost
VI test.com.conf

fffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk= "alt=" nginx anti-theft chain nginx access control Nginx parsing PHP-related configuration nginx agent "/ >
The Test status code is 200.

Replace IP re-Test status code is 200

To view the log, the source IP of 192.168.133.150 is 192.168.133.130

Prohibit. PHP parsing

Match regular, prohibit a PHP access
Editing a configuration file


Loading services and creating files

The test was denied access

How to access the 2.txt is allowed to be accessed

View Logs

Restrictions according to User_agent

Test

How to ignore the case is to match the symbol ~ followed by a

Add
Test before the number

After adding the * number


Create vi/data/wwwroot/test.com/3.php
Write content
<?php
Phpinfo ();
Curl accesses 3.php, no way to parse only the code that shows it

/usr/local/nginx/sbin/nginx-t
/usr/local/nginx/sbin/nginx-s Reload
Then execute the curl-x127.0.0.1 test.com/3.php and you can parse it.

Unix:/tmp/php-fcgi.sock write the wrong one less F, then access will prompt 502

Because I can't find the sock file.
View Logs

Vi/usr/local/php-fpm/etc/php-fpm.conf
Change the listening port to IP

Usr/local/php-fpm/sbin/php-fpm-t
/usr/local/nginx/sbin/nginx-s Reload
Then you need to restart/ETC/INIT.D/PHP-FPM reload
Viewing the Listening port

Access Tips 502

You need to change the configuration file

Load reboot

And curl access is not 502.

So after the 502 error will be checked to check what the port is, is not the configuration file corresponding to
There is also a case where the PHP-FPM process is exhausted and will prompt 502, this situation needs to be optimized
12.16 Nginx Agent

/usr/local/nginx/sbin/nginx-t
/usr/local/nginx/sbin/nginx-s Reload
Test

Extended
502 Questions Summary http://ask.apelearn.com/question/9109

Location-Priority http://blog.lishiming.net/?p=100

Nginx anti-theft chain nginx access control Nginx parsing PHP-related configuration Nginx agent

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.