Simple record:
Requirements description
The web server is Nginx and you want to configure generic subdomain resolution. In fact, with a little modification, configuring pan-domain name resolution is not difficult.
Resolution and Analysis
Make the following configuration (instruction) in the Nginx configuration file:
server { server_name domain.com www.domain. Com *.domain.com ; set $subdomain ''; if ($host ~* (\\b(?!www\\b).+)\\.domain.com) { set $subdomain -$1; } root /home/User/www$subdomain/; }
Explanation:
First, use the wildcard * when defining server_name to allow Nginx to accept access to any subdomain.
Then, analyze $host and find the name of the subdomain. This regular expression is copied online, in order to match the subdomain name, not the access at the beginning of www and the access without www. The previous set is because Nginx's If does not have Else, so the $subdomain is first empty by default. Finally, when defining root, use the $subdomain variable.
Software Name: Dynamic Network Forum Dvbbs Software Version: 7.0.0 SP2 Authorization: Free Softwar
IntroductionAWStats is a Perl-based WEB log analysis tool. AWStats operation mod
In the work, we often encounter a server in order to meet the needs of business access, there are tw
Friends who are familiar with FTP know that anonymous users do not need to enter a username and pass
Two major problems that lead to low cooling efficiency in the engine room
Method of setting port mapping and reverse proxy in Apache server
IIS Load Rewrite.dll Unsuccessful Red Arrow Down Solution
Detailed illustration of IIS6 installation and configuration of .net 2.0 process
1U rack server full range of features and management analysis
What if the server CPU is full?
The solution to send mail with Jmail component is wrong.
How to modify the default web port of apache
Motorola HMC3260 Android system to provide cloud entertainment services
NVIDIA discrete graphics card HDMI can not achieve extended display solution under XP system
Hardening security Configuring SSL
Setting up the Win10 system always reminds me that some settings are managed by your organization?
Wonderful use of Windows 7 system clock and calculator
20 strokes WindowsXP classic application skills
Win8 can't access the Internet, what should I do?
Microsoft Win 8 RP input method switching skills
Printer and print server in Win 2003
Using Group Policy to disable the driver to automatically install updates