Linux Nginx is quite common, So I studied Linux Nginx and shared it with you here. I hope it will be useful to you. Linux Nginx is currently recognized as a highly efficient proxy service and can be used for load balancing. Currently, the project only has one centOS server and cannot be used for testing. Therefore, we plan to find the Linux
Nginx. conf configuration file description
############################### Nginx. conf configuration file description # user nobody; # The user main module command instructs nginx worker to run users and user groups (user xxxuser xxxgroup). By default, worker_processes 1 is
############################### Nginx. conf configuration file description # user nobody; # The user main module command instructs nginx worker to run users and user groups (User xxxuser xxxgroup). By default, worker_processes 1 is run by nobody; # worker_processes main module command, command number of processes running ngin
;}will be able to successfully access to the home page, and this time the home is in the 8080 port corresponding to the domain (that is, Nginx service) is rendered, so the home page this time is no longer with the http://127.0.0.1:5000 domain, but with the Nginx service domain , In other words, the front-end request for Nginx service is no longer cross-domain.Acc
; fastcgi_param SCRIPT_FILENAME /data/wwwroot/test.com$fastcgi_script_name; }
Make a PHP
[[emailprotected] ~]# vim /data/wwwroot/test.com/3.php
Do a test.
[[emailprotected] ~]# curl -x127.0.0.1:80 test.com/3.php ##不能解析直接显示源码
The previous configuration did not reload so the top parsing did not succeed under load
[[emailprotected] ~]# /usr/local/nginx/sbin/ngin
parsing PHP related configuration#vi/usr/local/nginx/conf/vhost/test.com.conf#/usr/local/nginx/sbin/nginx-t#/usr/local/nginx/sbin/nginx-s ReloadIf the configuration file Fastcgi_pass Unix:/tmp/php-fcgi.sock, this path is not corr
It is actually a very simple method. Modify the nginx. conf file and add the following content:
Copy codeThe Code is as follows: location /{
If (-f $ request_filename/index.html ){
Rewrite (. *) $1/index.html break;
}
If (-f $ request_filename/index. php ){
Rewrite (. *) $1/index. php;
}
If (! -F $ request_filename ){
Rewrite (. *)/index. php;
}
}
Restart nginx.
be eliminated, so that the shell can be obtained.I remember FCK Php 2.6, there is a space bypass vulnerability. {Linux hosts do not work, Linux allows such files to exist}If you are in Apache. htaccess can be applied (Apache configuration file httpd.conf in the directory allowoverride set to all, Apache will apply the directory under the. htaccess configuration by Sfasfas),And can be uploaded, you can try to write in. htaccess:Shell.jpg replaced with the file you uploaded so that shell.jpg can
View the number of concurrent connections and connection status of Nginx, etc. under Linux.1. View the number of concurrent requests for the Web server (Nginx Apache) and its TCP connection status:Netstat-n | awk '/^tcp/{++s[$NF]} END {for (a in S) print A, s[a]} ' or:Netstat-n | awk '/^tcp/{++state[$NF]} END {for (key in state) print key, "T", State[key]} ' retu
/test.com$fastcgi_script_name;}#/usr/local/nginx/sbin/nginx-t#/usr/local/nginx/sbin/nginx-s Reload# vim/data/wwwroot/test.com/2.phpPhpinfo ();# curl-x 127.0.0.1:80 test.com/2.phpThe source code is accessed without reloading the configuration file before it can be parsed, and the content is seen in the access.When the s
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.