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)
cause The way to import external files into a min...
Recently, when I was working on a front-end vue.j...
This article shares the specific code of Vue usin...
Preface During my internship at the company, I us...
Open DREAMWEAVER and create a new HTML. . Propert...
CSS style: Copy code The code is as follows: <s...
NC's full name is Netcat (Network Knife), and...
When we learn HTML, the image tag <img> int...
1. Delete file command: find the corresponding di...
During the project optimization today, MySQL had ...
Table of contents Determine whether a record alre...
I recently added a very simple color scheme (them...
This is to commemorate the 4 pitfalls I stepped o...
The installation of compressed packages has chang...
Preface Not long ago, I combined browser-sync+gul...