In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Configuration is based on the client IP access jump today the company business version is online, all IP access anything displays a fixed maintenance page, only the company IP accesses the normal configuration instance to open two clients, view the two client IP addresses respectively, and configure the accessible IP addresses on the server
[root@localhost conf.d] # vim default.conf / / Edit configuration file. / / omit part of the content. # charset koi8-r; access_log / var/log/nginx/www.accp.com-access.log main; set $rewrite true / / set the legal IP tag if ($remote_addr = "192.168.144.128") {/ / determine whether it is a legitimate address, and if you perform the operation set $rewrite false for the legal address } if ($rewrite = true) {/ / determines whether it is an illegal address, marks it if it is illegal, does not operate the legal address rewrite (. +) / main.html;} location = / main.html {/ / matching tag, and executes the jump root / usr/share/nginx/html } location / {/ / Note here to delete the domain name jump-based configuration entry root / usr/share/nginx/html; index index.html index.htm set above }. / / omit part of the content.: wq [root@localhost conf.d] # cd / usr/share/nginx/html/ enter the nginx service site [root@localhost html] # ls / / View information 50x.html index.html [root@localhost html] # vim main.html / / Edit the redirected web content this is test web:wq [root@localhost html] # systemctl restart nginx/ / restart The website accesses the test in the client respectively.
Configure to redirect all posts under the domain name http://bbs.accp.com to http://www.accp.com/bbs based on the old and new domain name redirection and add a directory, and keep the parameters unchanged after the domain name jump [root@localhost html] # vim / etc/nginx/conf.d/default.confserver {listen 80; server_name bbs.aacp.com; / / change the domain name # charset koi8-r Access_log / var/log/nginx/www.accp.com-access.log main; location / post {/ / set matching fields, which perform jump operation rewrite (. +) http://www.accp.com/bbs$1 permanent } / / Note to delete the configuration entry location / {root / usr/share/nginx/html; index index.html index.htm;} # error_page 404 / 404.html based on client IP access set above # redirect server error pages to the static page / 50x.html...// omitted part of the content.: wq [root@localhost html] # vim / var/named/accp.com.zone / / Edit the DNS server region data file $TTL 1D @ IN SOA @ rname.invalid. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum NS @ A 127.0.0.1bbs IN A 192.168.144.133 / change host header resolution: WQ [root @ localhost html] # systemctl restart nginx / / restart the nginx service [root@localhost html] # systemctl restart named / / restart the DNS service to test access in the client
Configure redirected browser access based on matching parameter access http://www.accp.com/100-(100|200)-100.html jump to http://www.accp.com page [root@localhost html] # vim / etc/nginx/conf.d/default.confserver {listen 80; server_name www.aacp.com; / / change the server domain name to www # charset koi8-r Access_log / var/log/nginx/www.accp.com-access.log main; if ($request_uri ~ ^ / 100-(100 | 200)-(\ d +) .html $) {/ / delete the configuration entry rewrite (. *) http://www.accp.com permanent based on the new and old domain name jump and adding directory jump set here And set the parameter-based access to jump back to the main web page} location / {root / usr/share/nginx/html; index index.html index.htm;} # error_page 404 / 404.html; # redirect server error pages to the static page / 50x.html # error_page 500502 503504 / 50x.html . / / omit some content.: wq [root@localhost html] # vim / var/named/accp.com.zone$TTL 1D @ IN SOA @ rname.invalid. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum NS @ A 127.0.0.1www IN A 192.168.144.133 / change host header resolution: WQ [root @ localhost html] # systemctl restart nginx / / restart nginx service [root@localhost html] # systemctl restart named / / restart DNS service access test in the client
Configuration is based on all php files in the directory jump access http://www.accp.com/upload/1.php jump to the home page [root@localhost html] # vim / etc/nginx/conf.d/default.conf / / edit the configuration file server {listen 80; server_name www.aacp.com; # charset koi8-r; access_log / var/log/nginx/www.accp.com-access.log main Location ~ * / upload/.*\ .php ${/ / delete the matching parameters set above to jump to access, and configure to match all php ending visits to jump back to the home page rewrite (. +) http://www.accp.com permanent;} location / {root / usr/share/nginx/html; index index.html index.htm;} # error_page 404 / 404.html ... omit part of the content.: wq [root@localhost html] # systemctl restart nginx / / restart the nginx service to access the test in the client
Configure redirected access based on the most common url requests A specific page jumps to the home page [root@localhost html] # vim / etc/nginx/conf.d/default.conf / / Edit configuration file server {listen 80; server_name www.aacp.com; # charset koi8-r; access_log / var/log/nginx/www.accp.com-access.log main Location ~ * ^ / abc/123.html {/ / delete the above configuration and re-edit a specific page to visit the web page and jump back to the home page rewrite (. +) http://www.accp.com permanent;} location / {root / usr/share/nginx/html; index index.html index.htm;} # error_page 404 / 404.html . / / omit some content.: wq [root@localhost html] # systemctl restart nginx / / restart the nginx service to test access in the test machine
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.