proportional to the size of the memory, the number of files that can be opened on a 1GB memory machine is about 100,000 or so.# Let's take a look at the number of file handles that the VPS of 360M memory can open:# $ Cat/proc/sys/fs/file-max# Output 34336# 32000 # Therefore, the value of worker_connections should be set appropriately based on the number of worker_processes processes and the maximum number of files that the system can open# makes the number of concurrent totals less than the max
Nginx virtual host configuration instance
1. Add the virtual host configuration at the end of the/usr/local/nginx/CONF/nginx. conf file. The instance is as follows:
Server{Listen 80;
After installing the Nginx server under the Linux of the virtual machine, the machine can get the webpage content through curl, and the host cannot access it, the following error appears:
In this case, usually the Linux system firewall rules need to be configured to open the network ports you need to access, set the following:
Open the file/etc/sysconfig/ipt
,serversuch as the aboveSet $game _name game4;2.if instructionif (condition) {...}The scope of action isSuch as:if ($host ~ "game-taiwan-5"){Set $game _name game5;}The IF directive is used to check if a condition conforms, and if the condition is met, the contents inside the curly braces are executed.Reference Documentation:Http://serverfault.com/questions/241005/nginx-change-root-directory-based-on-server-
RHEL7 down Nginx Virtual Host Configuration in the first two sections of the installation and configuration files, here write the configuration file, you can modify the configuration file according to the content. http { server{ Listen ; server_name 192.168.1.20; access_log log/192.168.1.20 main; Location /{Index index.html;Root /application/
, but B is not allowed to access it, therefore, no input files will appear after the second site is opened. What solution is there?
We can send different virtual hosts to different PHP-CGI ports for processing. Of course, the open_basedir in the PHP-FPM configuration file in the response is also different .. Let's see how to configure it ..
First, configure nginx. conf as follows:
Server{Listen 80;SER
Nginx configuration file does not have the relevant rewrite jump rules, then it should be MediaWiki PHP program to do the jump, but, traverse the MediaWiki directory of all files and query the MySQL database of each table, no record of this domain name is found. Later, by looking at the source code found MediaWiki is based on the $_server[' server_name '] do the jump, follow the clues, found the following issues:In a
To implement three types of virtual hosts need to modify the code under Http\server in the Nginx nginx.conf file, share two ways to configure a virtual host:
# domain-based virtual host
server {
listen; # Listen to the P
1. Add a configuration fileCreate a new file under /etc/nginx/sites-available/ phpMyAdminFile contentsserver {Listen 80;Listen [::]:80;server_name the domain name to be set;Root/var/www/html/phpmyadmin;Index index.html index.php; location/{ try_files $uri $uri/=404; } location ~ \.php$ { include snippets/ fastcgi-php.conf; fastcgi_pass Unix:/var/run /php5-fpm.sock; } Span style= " font-family: ' comic sans ms ', sans-serif;
Because of a long time did not configure Apache, although said know how to configure Nginx, but it took some time to write down the next time directly withOn the other options File menu, open configuration file, select Vhosts-confNginx words useserver {Listen80; server_name the name of your virtual directory; Root"The directory path you want to manipulate"; Location/ {index index.html index.htm index
Nginx configuration Yii and phpMyAdmin virtual host
The problem comes when we often need to use nginx when we deploy the project, we need to support URL rewriting, and we have to install a phpmyadmin. How do I get phpMyAdmin out of the Web root directory? Here is a sample configuration file:
?
server{Listen 80; s
Because of a long time did not configure Apache, although said know how to configure Nginx, but it took some time to write down the next time directly withOn the other options File menu, open configuration file, select Vhosts-confNginx words useserver { listen ; server_name the name of your virtual directory; Root "directory path you want to manipulate"; Location/{
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.