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
Table of contents 1. Introduction 2. Main text 2....
I have learned some basic selectors of CSS before...
Table of contents String length: length charAt() ...
When using docker, you may find that the file can...
This article introduces a framework made by Frame...
1. Install libfastcommon-1.0.43. The installation...
1. Environment and related software Virtual Machi...
Without going into details, let's go straight...
Authorization is to grant certain permissions to ...
Table of contents Overview Virtual Dom principle ...
This article records the installation graphic tut...
Database application is an indispensable part of ...
The <TH> tag is used to set the properties ...
If you are looking to monitor your system interac...
Carousel The main idea is: In the large container...