In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Nginx related operations
Operation under Windows: 1. Start: C:\ server\ nginx-1.14.2 > start nginx or C:\ server\ nginx-1.14.2 > nginx.exe Note: the first is recommended, and the second will keep your cmd window in execution all the time, and no other command operations can be carried out. 2. Stop: C:\ server\ nginx-1.14.2 > nginx.exe-s stop`` or C:\ server\ nginx-1.14.2 > nginx.exe-s quit Note: stop is to quickly stop nginx and may not save relevant information; quit is to stop nginx in a complete and orderly manner and save relevant information. 3. Reload Nginx: C:\ server\ nginx-1.14.2 > nginx.exe-s reload use this command when the configuration information is changed and you need to reload these configurations. 4. Reopen the log file: C:\ server\ nginx-1.14.2 > nginx.exe-s reopen 5, and view the Nginx version: C:\ server\ nginx-1.14.2 > nginx- v
Nginx reverse proxy path problem
The difference between http://abc.com:8080 and http://abc.com:8080/ writing is as follows: without / location / NginxTest/ {proxy_pass http://abc.com:8080;} with / location / NginxTest/ {proxy_pass http://abc.com:8080/; } the only difference between the above two configurations is whether the path forwarded by proxy_pass is followed by "/". For case 1: (with parameters) if you access url = http://localhost:90/NginxTest/servlet/MyServlet?name=123333333, after being proxied by nginx, the request path will access http://abc.com:8080/NginxTest/servlet/MyServlet?name=123333333. (no parameters) if you access url = http://localhost:90/NginxTest/servlet/MyServlet, the request path will access http://abc.com:8080/NginxTest/servlet/MyServlet after being proxied by nginx. For case 2: if you access url = http://server/NginxTest/test.jsp, after being proxied by nginx, the request path will change to http://proxy_pass/test.jsp and directly access the root resource of server. Access http://localhost:90/NginxTest/NginxTest/NginxTest/servlet/MyServlet, and the request path will not access http://abc.com:8080/NginxTest/servlet/MyServlet until it is proxied by nginx. * * Note: the difference between the above two access paths. Restart the nginx agent successfully after modifying the configuration. **
Nginx address rewriting
Location / NginxTest/ {rewrite ^ / NginxTest/ (. *) $/ $1 break; proxy_pass http://abc.com:8080;} 1. ^ ~ / NginxTest/ is a matching rule that intercepts requests, matches any address that starts with / NginxTest/, and stops searching for rules after the match. 2.rewrite ^ / NginxTest/ (. *) $/ $1 break; means to rewrite the intercepted request, and can only work on the string after the domain name except for the passed parameters, such as http://localhost:90/NginxTest/NginxTest/servlet/MyServlet?name=lovleovlove rewriting, only / NginxTest/NginxTest/servlet/MyServlet rewriting. For example, the access address: http://localhost:90/NginxTest/NginxTest/servlet/MyServlet?name=lovleovlove, the actual access address (rewrite address) is http://ita-1312-0059.synacast.local:8080/NginxTest/servlet/MyServlet?name=lovleovlove, for example, the access address: http://localhost:90/NginxTest/NginxTest/servlet/MyServlet The actual access address (rewrite address) is http://ita-1312-0059.synacast.local:8080/NginxTest/servlet/MyServlet 3.rewrite, followed by a simple regular ^ / NginxTest/ (. *) $/ $1, where $1 represents the first () in the regular, $2 represents the value of the second (), and so on. Break means to stop matching after matching one. Syntax of rewrite: rewrite regex URL [flag] Rewrite is the keyword, regex is the regular expression, URL is the content to be replaced, and [flag] means the mark bit. It has the following values: last: equivalent to the [L] tag of Apache, indicating completion of rewrite break: stop executing the subsequent rewrite instruction set of the current virtual host redirect: return 302 temporary redirection, the address bar will display the jump address permanent: return 301 permanent redirection The address bar displays the address after the jump.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.