When configuring the interface domain name, each public platform will verify the developer's configuration rights over the domain name, generate random text and strings, and allow those placed in the domain name root directory to be directly accessed through the domain name, thus passing the verification. The example verifies that the domain name abc.com can access 6CysNYj8Hb.txt through the root route. The response body is the string 01df2ddab4774ba2676a5563ccb79ffa. $ curl https://abc.com/6CysNYj8Hb.txt 01df2ddab4774ba2676a5563ccb79ffa Solution 1 For a server with root, you can simply place random documents in this directory without restarting the nginx service. Solution 2 Match the route, specify the directory where the random document is located, and restart nginx. location ~* 6CysNYj8Hb\.txt { root /data/ftp; } Option 3 (recommended) Match the route and directly return the random string that needs to be verified. You need to restart nginx. location = /6CysNYj8Hb.txt { default_type text/html; return 200 '01df2ddab4774ba2676a5563ccb79ffa'; } refer to Nginx Location configuration from scratch nginx configuration returns text or json Supplement: Nginx domain name redirection 1. Change the configuration file test.com.conf [root@jimmylinux-001 vhost]# vim test.com.conf server { listen 80; server_name test.com test2.com test3.com; index index.html index.htm index.php; root /data/wwwroot/test.com; if ($host != 'test.com' ) { rewrite ^/(.*)$ http://test.com/$1 permanent; } } 2. curl test [root@jimmylinux-001 vhost]# /usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful [root@jimmylinux-001 vhost]# /usr/local/nginx/sbin/nginx -s reload [root@jimmylinux-001 vhost]# curl -x127.0.0.1:80 test2.com/index.html -I HTTP/1.1 301 Moved Permanently Server: nginx/1.12.1 Date: Thu, 07 Jun 2018 16:47:36 GMT Content-Type: text/html Content-Length: 185 Connection: keep-alive Location: http://test.com/index.html [root@jimmylinux-001 vhost]# curl -x127.0.0.1:80 test2.com/admin/index.html -I HTTP/1.1 301 Moved Permanently Server: nginx/1.12.1 Date: Thu, 07 Jun 2018 16:48:08 GMT Content-Type: text/html Content-Length: 185 Connection: keep-alive Location: http://test.com/admin/index.html [root@jimmylinux-001 vhost]# curl -x127.0.0.1:80 test3.com/admin/index.html/adjlfj -I HTTP/1.1 301 Moved Permanently Server: nginx/1.12.1 Date: Thu, 07 Jun 2018 16:48:35 GMT Content-Type: text/html Content-Length: 185 Connection: keep-alive Location: http://test.com/admin/index.html/adjlfj [root@jimmylinux-001 vhost]# curl -x127.0.0.1:80 test4.com/admin/index.html/adjlfj -I HTTP/1.1 404 Not Found Server: nginx/1.12.1 Date: Thu, 07 Jun 2018 16:48:43 GMT Content-Type: text/html Content-Length: 169 Connection: keep-alive The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Nest.js hashing and encryption example detailed explanation
>>: How to recover accidentally deleted table data in MySQL (must read)
Use the --all-database parameter when performing ...
login.html part: <!DOCTYPE html> <html l...
The Linux seq command can generate lists of numbe...
Of course, there are many people who hold the oppo...
MySQL versions are divided into Enterprise Editio...
Nginx Rewrite usage scenarios 1. URL address jump...
Table of contents utils: Use in vue: explain: Ima...
First check the /etc/group file: [root@localhost ...
Problem description (what is keep-alive) keep-ali...
Intersection Selector The intersection selector i...
We know that there are two ways to receive incomi...
MySQL v5.7.19 official version (32/64 bit install...
Isolation of process address spaces is a notable ...
Sophie Hardach Clyde Quay Wharf 37 East Soapbox Rx...
How to define complex components (class component...