Nginx virtual host configuration tutorial, nginx virtual host tutorial
It is to start multiple websites on one server.
There are two ways to differentiate different websites:
1. Different domain names
2. Different portsDifferentia
Case 1: Building an Nginx serverCase 2: User authenticationCase 3: Domain-based virtual hostCase 4:SSL Virtual Host1 Case 1: Building Nginx Server1.1 QuestionsInstall the Nginx service on the host with IP address 192.168.4.5 and t
The most important thing is to add this line to the server's settings:
Listen default;
The following default parameter indicates that this is the default virtual host.
This setting is very useful.
For example, when someone accesses your website via IP or unknown domain name, you want to suppress any valid content and return 500 to him.
At present, a lot of domestic computer rooms are required to shut down
close the child processKill-hup ' cat/usr/local/nginx/logs/nginx.pid ' restart serviceExperiment (II)Experimental Purpose: The company currently has a number of sites to be published, due to limited funds and in order to save resources and improve the utilization of resources, the company decided to publish multiple sites on a single server and user access to do some restrictions.1. Domain-based virtual ho
correct configuration file, so as to prevent the server from restarting after the reboot. Determine if the Nginx configuration is the correct command as follows:/usr/nginx/conf/nginx.conf /usr/nginx/sbin/nginx -tVirtual Host Configuration # domain-based
/usr/local/nginx/passwd.db; 7 ~]#nginx-t8 ~]#service Nginx Reload(2) Client-based access controlNginx Client-based access control is simpler than Apache, the rules are matched from top to bottom, if the match is stopped, no longer matches downFormat:Deny IP/IP segmentAllow IP/IP segmentExample: In addition to the 10.1.1.0 network segment, 192.168.1.0 network se
Label: style blog Io color OS use SP file Div
Bytes -------------------------------------------------------------------------------------------------------
Configure the VM:
1. Bind a domain name
Vim/etc/hosts # Add a format such as 192.168.1.11 www. chenwei. ws
2. Add a VM
CD to the root directory, run vhost. Sh to add the VM, and enter the domain name.
3. Edit the configuration file
Vim/usr/local/nginx/CONF/vhost/www. chenwei. ws. co
Mud: Use nginx to build a WordPress blog using a virtual host, nginxwordpress
This article was sponsored by Xiuyi linfeng and first launched in the dark world.
Recently, I plan to learn about nginx web servers. Since it is learning or practical. We will build a WordPress blog here as an example.
To build a WordPress
, the first method is to load the/usr/local/nginx/CONF/nginx. conf configuration file by default.
We can see it clearly. Nginx has been started and can be accessed normally.
Now let's look at the users running nginx, as follows:
PS-Aux | grep nginx
We can see that
First, preface
First of all, you need to make sure that the Nginx is properly installed on your Linux system, but if you do not install Nginx, please refer toSystem environment:Linux Environment: centos-7.2Nginx Environment: nginx-1.9.9Second, about NginxNginx is a high-performance HTTP server/reverse proxy server and e-mail (IMAP/POP3) proxy server. Developed
Installing PcreTAR-XVF pcre-8.32.tar.gzcd pcre-8.32./configuremake;make Install Nginx first create an Nginx user to run Nginxuseradd with Nginx user NGINXTAR-XVF nginx-1.2.7.tar.gzcd nginx-1.2.7./configure--user=nginx--group=
virtual machine 192.168.101.3 insteadConfiguration of the virtual host:
to modify the/usr/local/nginx/conf/nginx.conf file, add two virtual hosts as follows:# Configure virtual
Nginx's users have recently become more and more, and many large Web sites have migrated from Apache or other platforms to Nginx. But there is one problem that I have not solved in the process of using nginx is how to restrict the directory permissions of nginx+php.We know that in Apache you can easily control the permissions of the
Continue my Nginx learning journey today and talk about the configuration of the virtual host. What is a virtual host? Virtual host uses a special hardware and software technology, it i
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.