Configure multiple servers in nginx.conf: When processing an http request, nginx will take out the host in the header and match it with the server_name of each server in nginx.conf to determine which server block will handle the request. The server_name inside: is used to configure name-based virtual hosts In addition to exact matches, you can also use wildcards: 1. A string starting with the * wildcard character: server_name *.domain.com; 2. Characters ending with the * wildcard server_name www.*; 3. Matching regular expressions server_name ~^(?.+).domain.com$; server { listen 80 default_server; server_name www.123.com; root /home/web1; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50.xhtml; location = /50x.html { } } server { server_name www.abc.com; root /home/web2; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: JS implements simple calendar effect
After obtaining the system time using Java and st...
I don’t know why, but UI likes to design honeycom...
The utf8mb4 encoding is a superset of the utf8 en...
Table of contents Basic Edition Step 1: Configure...
1. Create a docker network card [root@i ~]# brctl...
1. What is In react applications, event names are...
By chance, I discovered that a SQL statement prod...
Table of contents Preface: 1. Install Docker 2. I...
Preface: After studying the previous article, we ...
Table of contents cause: go through: 1. Construct...
How to use the code in NetEase Blog: First log in...
There is no problem with the Dockerfile configura...
Regarding some MySQL specifications, some compani...
Preface Transactional data dictionary and atomic ...
This article shares the specific code of fabricjs...