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. Conditions for joint index f...
background Not long ago, I made a function about ...
Table of contents Water wave effect Let's see...
MySQL transaction support is not bound to the MyS...
Table of contents Preface Prepare Summarize n way...
This article shares the specific code of Vue to i...
Table of contents 1 Install Docker in Baota Softw...
1. Set up a shared folder on the virtual machine:...
Preface JSON is a lightweight data exchange forma...
Table of contents 1. Check the number of Linux bi...
Caused by: java.sql.SQLException: Incorrect strin...
Add table fields alter table table1 add transacto...
Introduction to Flex Layout Flex in English means...
<br />This tag is used to create a multi-lin...
Preface: Because many business tables use design ...