Preface Recently, I have been helping clients configure servers and frequently modifying Nginx configuration files. I have frequently used regular matching rules. Here are some commonly used regular parameters and rules for your reference. The syntax rules of Location in Nginx configuration
Matching order When multiple locations are configured, the matching order is:
Common rules Exact Match location = / { proxy_pass http://127.0.0.1:9090/ } Forward all requests directly to port 9090 of the server. Serving static files #Directory matching location ^~ /static/ { root /webroot/static/; } #Suffix matching location ~* \.(gif|jpg|jpeg|png|css|js|ico)$ { root /webroot/res/; } Forward dynamic requests to the backend application server #Forward requests starting with /account/ to the Account server location /account/ { proxy_pass http://127.0.0.1:8080/ } #Forward requests starting with /order/ to the Order server location /order/ { proxy_pass http://127.0.0.1:9090/ } rewrite directive
Summarize This is the end of this article about Nginx regular expression related parameters and rules. For more relevant Nginx regular parameters and rules, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of various methods for JavaScript to determine whether it is an array
>>: Detailed explanation of MySQL 8.0.18 commands
Table of contents 1. typeof 2. instanceof 3. Diff...
Table of contents 1. Object change detection 2. Q...
Frequently asked questions When you are new to ea...
Table of contents 1. Optional Chaining 2. Null va...
This article shares the mysql5.6.24 automatic ins...
This article collects 20 excellent web page color ...
Select or create a subscription message template ...
Set Tomcat to automatically start the service: I ...
Preface Seeing the title, everyone should be thin...
1. Introduction I won’t go into details about apo...
Table of contents 1. What is a trigger? 2. Create...
The default program publishing path of tomcat7 is...
Introduction Closure is a very powerful feature i...
It's simple, just go to the tutorial, blogger...
If you want to install some 64-bit applications (...