://ask.apelearn.com/question/17964" This is referer information, mozilla/5.0 (Windows NT 6.3; WOW64) applewebkit/537.36 (khtml, like Gecko) chrome/49.0.2623.112 safari/537.36 This long string is useragent informationWe use the Curl command to access,-e specifies that referer-a specifies useragent can interpret lvlinux as a crawler messagecurl -x127.0.0.1:80 -e "http://www.baidu.com" -A "lvlinux" 123.comcurl -x127.0.0.1:80 123.comCompare the above two access logs, we found the first visit recorde
that does not belong to the above configurationCurl-x127.0.0.1:80 Test.com/1.js-iCurl-x127.0.0.1:80 Test.com/2.jpg-iCurl-x127.0.0.1:80 Test.com/1.jss-iWe can see from the previous two access results that there is a max-age, that is, the cache that we defined earlier is valid for the duration, in seconds. One of the JSS files is not in the configuration, so there is no such item.Finally, we look at the acce
First, nginx anti-theft chainThe configuration is as follows and can be combined with the above configuration.Location ~* ^.+\. (Gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|xls) ${Expires 7d;Valid_referers none blocked Server_names *.test.com;if ($invalid _referer){return 403;}Access_log off;}Second, Nginx access controlRequirements: Access to the/admin/directory request, only a few IP access is allowed, configured as follows:location/admin/{Allow 192.168.1.1101;Allow 127.0.0.1;Deny all;
Original address: http://my.oschina.net/epstar/blog/513186Curl Plain Text Format output:ifconfig . Mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ipcurl ipecho.net/Plaincurl Www.trackip.net/ICurl JSON format output:Curl ipinfo.io/ifconfig. me/all.jsoncurl www.trackip.net/ip?json (a bit ugly)Curl XML Format output:ifconfig. Me/all.xmlCurl gets all IP details (excavator)1 ifconfig. Me/allUse Dydns (useful when you use the Dydns service)' http://ch
/admin/1.html/usr/local/nginx/sbin/nginx -t/usr/local/nginx/sbin/nginx -s reload curl -x127.0.0.1:80 test.com/admin/1.html -I curl -x192.168.1.111:80 test.com/admin/1.html -I
Before adding a ENS37 virtual network card, now change it to host mode, get the host IP for testing.
Match regular limit
location ~ .*(upload|image)/.*\.php${ deny all;}mkdir /data/wwwroot/test.com/uploadecho 12321 > /data/wwwroot/test.com/upload/1.phpcurl -x127.0.0.1:80 test.com/upload/1
Several ways to query the IP of the extranet under Linux. Curl Plain Text Format output:curlicanhazip.comcurlifconfig.mecurlcurlmyip.comcurlip.appspot.comcurlipinfo.io/ipcurlipecho.net/plaincurlwww.trackip.net/iCurl JSON format output:curlipinfo.io/jsoncurlifconfig.me/all.jsoncurlwww.trackip.net/ip?json(有点丑陋)Curl XML Format output:curlifconfig.me/all.xmlCurl gets all IP details (excavator)curlifconfig.me/allUse Dydns (useful when you use the Dydns ser
test.com/2.js//Status code 200, normal access;Curl-e "Http://www.baidu.com/1.txt" -x127.0.0.1:80-i test.com/2.js//403 Forbidden12.14 Nginx Access ControlAccess control, allow to specify IP access, other inaccessible;vim/usr/local/nginx/conf/vhost/test.com.conf //server Add the following information---------------------------------------------------------location/admin/{Allow 192.168.133.1;Allow 127.0.0.1;Deny all;}----------------------------------------------------------mkdir/data/wwwroot/test
-control:max-age= 604800accept-ranges:bytes above two tests indicate that the anti-theft chain has succeeded 12.14 Nginx Access ControlRequirements: Access to the/admin/directory request, only a few IP access is allowed, configured as follows:location/admin/{Allow 192.168.133.1;Allow 127.0.0.1;Deny all;}mkdir/data/wwwroot/test.com/admin/echo "Test,test" >/data/wwwroot/test.com/admin/1.html-T -S reloadCurl-x127.0.0.1:80 Test.com/admin/1.html-iCurl-x192
Curl Plain Text Format output:Curl Icanhazip.comcurl ifconfig.mecurl curlmyip.comcurl ip.appspot.comcurl ipinfo.io/ipcurl ipecho.net /Plaincurl www.trackip.net/ICurl JSON format output:Curl ipinfo.io/jsoncurl ifconfig.me/all.jsoncurl www.trackip.net/ip?json (a bit ugly)Curl XML Format output:Curl Ifconfig.me/all.xmlCurl gets all IP details (excavator)Curl Ifconfig.me/allUse Dydns (useful when you use the Dydns service)' http://checkip.dyndns.org ' ' s
Ifconfig.meCurl curlmyip.comCurl ip.appspot.comCurl IPINFO.IO/IPCurl Ipecho.net/plainCurl www.trackip.net/iCurl JSON format output:Curl Ipinfo.io/jsonCurl Ifconfig.me/all.jsonCurl Www.trackip.net/ip?json(A little ugly) Curl XML format output:Curl Ifconfig.me/all.xmlCurl gets all IP details (excavator)Curl Ifconfig.me/allUse Dydns (useful when you use the Dydns service)Curl-s ' http://checkip.dyndns.org ' | Sed ' s/.*current IP address: \ ([0-9\.] *\)
One, Apache user authenticationVim/usr/local/apache2.4/conf/extra/httpd-vhosts.confEdit the 111.com virtual host to the following:DocumentRoot "/data/wwwroot/www.111.com"ServerName www.111.comAllowOverride authconfig//This equivalent to open the authentication switchAuthName "111.com user auth"//Custom certified name, not very usefulAuthType Basic//authentication type, generally basicAUTHUSERFILE/DATA/.HTPASSWD//Specify the location of the password fileRequire Valid-user//specify that users who
The purpose of this example is to: 1 Learn how to traverse all files in a specified folder 2 how the console enters and outputs the data code:Using system;using system.io;namespace tosql{class tosql{static void Main () {String path = System.Environment.CurrentDirectory; System.Console.WriteLine ("Enter the folder name to read"); string name = Console.ReadLine ();p ath + = "\" + name; Getallfile (path);} public static void Getallfile (string path) {DirectoryInfo di = new DirectoryInfo (path);D ir
Post-Configuration test:Curl-x127.0.0.1:80 ' http://123.com/admin.php 'Curl-a "baidu.com"-x127.0.0.1:80 ' http://123.com/upload/admin.php '-ICurl-a "qq.com"-x127.0.0.1:80 ' http://123.com/admin.php '-ITail-n 5/usr/local/apache2.4/logs/123.com-access_20180306.logThe view log verifies again that the rejected 2 access user_agent contain curl and baidu.com, respectively.conclusion : The Curl Direct test (This is user_agent contains curl) and the specif
12.10 Nginx Access Log
The format of the Nginx access log is defined in the master configuration file.
vim/usr/local/nginx/conf/nginx.conf//Search Log_format
Log field Meaning:$remote _ADDR Client IP (public IP)$http IP of the _x_forwarded_for proxy server$time _local Server local time$host Access host name (domain name)$request URL address for _uri access$status Status Code$http _referer Referer$http _user_agent User_agent
In addition to defining the log format in the Maste
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.