对中文网址和中文路径的支持

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/juewuer/article/details/82791707

一直说可以用中文网址了,于是我申请了一个 技术支持.在线
绑定到一个ip上,为了防止这个ip被攻击,就不写出了,下面用A.B.C.D表示,然后我在centos上curl一下

[~]$ curl 云计算。技术支持。在线/金山 -v
* Input domain encoded as `UTF-8'
* About to connect() to xn--9kqp11i6bk.xn--2qu2kx9cr0c.xn--3ds443g port 80 (#0)
*   Trying <A.B.C.D>...
* Connected to 云计算。技术支持。在线 (A.B.C.D) port 80 (#0)
> GET /金山 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: xn--9kqp11i6bk.xn--2qu2kx9cr0c.xn--3ds443g
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: CLOUD ELB 1.0.0
< Date: Thu, 20 Sep 2018 10:09:46 GMT
< Content-Type: application/octet-stream
< Content-Length: 183
< Connection: keep-alive
< 
[2018-09-20T18:09:46+08:00]http server<vm10-0-0-10.ksc.com> [] in 100.68.80.2:6794 -> _, xn--9kqp11i6bk.xn--2qu2kx9cr0c.xn--3ds443g, (RS:10.0.0.10:8000), 0 bytes send by curl/7.29.0

* Connection #0 to host 云计算。技术支持。在线 left intact

curl成功,说明ksyun的网络支持中文
再试试域名解析,dig一把

[~]$ dig 云计算。技术支持。在线

; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7_4.2 <<>> 云计算。技术支持。在线
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44569
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;云计算.技术支持.在线.  IN      A

;; ANSWER SECTION:
云计算.技术支持.在线. 62 IN     A       A.B.C.D

;; Query time: 5 msec
;; SERVER: 192.168.12.19#53(192.168.12.19)
;; WHEN: Thu Sep 20 18:09:49 CST 2018
;; MSG SIZE  rcvd: 87

nginx的log文件

配置文件格式

 "$time_iso8601 $remote_addr:$remote_port $server_addr:$server_port $upstream_addr $request_time $upstream_response_time $status $upstream_status $request_length $body_bytes_sent \
"$request_method $scheme://$http_host$request_uri $server_protocol\" \"$http_referer\" \"$http_user_agent\"";

结果

2018-09-20T18:09:46+08:00 114.255.44.141:49632 A.B.C.D:80 10.0.0.10:8000 0.001 0.001 200 200 112 183 “GET http://云计算.技术支持.在线/\xE9\x87\x91\xE5\xB1\xB1 HTTP/1.1” “-” “curl/7.29.0”

结果:金山云是可以完美的支持中文域名和路径的。

猜你喜欢

转载自blog.csdn.net/juewuer/article/details/82791707