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
Download address: https://dev.mysql.com/downloads...
Table of contents 1. Stop MySQL Server first 2. U...
MySQL 8.0.20 installation and configuration super...
Query the MySQL source first docker search mysql ...
Table of contents 1. Problem 2. Solution 1. Decla...
Sometimes you may encounter a situation where a S...
Use the browser (webdriver)-based selenium techno...
<br />Previously, we learned how to set cell...
join() method: connects all elements in an array ...
This article shares with you the solution to the ...
Data backup and restoration part 2, as follows Ba...
Docker has been very popular in the past two year...
Preface: Recently, the company project changed th...
Today I will take you through the history of ext4...
Nine simple examples analyze the use of HTML form...