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)
Recently, I used html-webapck-plugin plug-in for ...
Table of contents jQuery's $.ajax The beginni...
In this article, we’ll explore how async/await is...
Principle: First hide the input element, then use...
General form prompts always occupy the form space...
Preface I recently used a virtual machine to inst...
1. Installation Environment Computer model: Lenov...
Startups often bring us surprises with their unco...
Effective solution for Ubuntu in virtual machine ...
Effect diagram: Overall effect: Video loading: Ph...
Table of contents Preparation Install VMware Work...
Vue bus mechanism (bus) In addition to using vuex...
At the beginning of this article, I would like to ...
Create docker-compose.yml and fill in the followi...
About who Displays users logged into the system. ...