- [root@martin001 vhost]# /usr/local/nginx/sbin/nginx -s reload
- [root@martin001 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@martin001 vhost]# cd /data/wwwroot/test.com/
- [root@martin001 test.com]# ls
- index.html
- [root@martin001 test.com]# vim 1.gif
- [root@martin001 test.com]# vim 2.js
- [root@martin001 test.com]# curl -x127.0.0.1:80 test.com/1.gif
- dfgsdfgsdfgsdfg
- [root@martin001 test.com]# curl -x127.0.0.1:80 test.com/2.js
- dfasdfasdfasdf
- [root@martin001 test.com]# curl -x127.0.0.1:80 test.com/index.html
- test.com
- [root@martin001 test.com]# cat /tmp/test.com.log
- 127.0.0.1 - [15/Mar/2018:00:19:27 +0800] test.com "/index.html" 200 "-" "curl/7.29.0"
- [root@martin001 test.com]# curl -x127.0.0.1:80 test.com/index.html
- test.com
- [root@martin001 test.com]# cat /tmp/test.com.log
- 127.0.0.1 - [15/Mar/2018:00:19:27 +0800] test.com "/index.html" 200 "-" "curl/7.29.0"
- 127.0.0.1 - [15/Mar/2018:00:20:51 +0800] test.com "/index.html" 200 "-" "curl/7.29.0"
- [root@martin001 test.com]# curl -x127.0.0.1:80 test.com/2.jsghfgfh
- <html>
- <head><title>404 Not Found</title></head>
- <body bgcolor="white">
- <center><h1>404 Not Found</h1></center>
- <hr><center>nginx/1.12.1</center>
- </body>
- </html>
- [root@martin001 test.com]# curl -x127.0.0.1:80 test.com/2.js -I
- HTTP/1.1 200 OK
- Server: nginx/1.12.1
- Date: Wed, 14 Mar 2018 16:21:27 GMT
- Content-Type: application/javascript
- Content-Length: 15
- Last-Modified: Wed, 14 Mar 2018 16:18:11 GMT
- Connection: keep-alive
- ETag: "5aa94b43-f"
- Expires: Thu, 15 Mar 2018 04:21:27 GMT
- Cache-Control: max-age=43200
- Accept-Ranges: bytes
来源: http://www.bubuko.com/infodetail-2527660.html