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. Discover the problem 2. Dele...
This article example shares the specific code of ...
First, let's talk about why we need to divide...
Table of contents vue - Use swiper plugin to impl...
Table of contents 1.1. Network access between con...
Detailed explanation of MySQL sorting Chinese cha...
1. Do a good job of cleaning before installation ...
1. The window size opened by the HTML hyperlink C...
<br />This section introduces how to impleme...
Table of contents Overview Single file components...
1. Windows Server 2019 Installation Install Windo...
Only show the top border <table frame=above>...
1: Check the PHP version after entering the termi...
Table of contents Implementation ideas There are ...
MySQL 5.7.27 detailed download, installation and ...