发表于: 2017-10-24 16:48:53

1 663


今天完成的任务



参考了不少资料


对nginx.conf进行了自己的修改


在access.log文件中添加了响应时间和请求时间

------------------------------------------------------------------------------------------


所修改的nginx.conf如下,在此以//为注释说明了修改内容

#user  nobody;
worker_processes  1;//使用的CPU核数


error_log  logs/error.log;//error文档存放的地址
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        logs/nginx.pid;//pid文件的位置,这个我看了一下,只有写是哪一个线程

events {
    worker_connections  1024;//最大连接数
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '$upstream_response_time  $request_time'
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;//配置access

    sendfile        on;//指定是否使用OS的sendfile函数来传输文件。

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }


参考资料

http://www.nginx.cn/591.html

http://blog.csdn.net/tjcyjd/article/details/50695922

http://www.cnblogs.com/justbio/p/5535466.html

http://www.linuxidc.com/Linux/2013-03/81738.htm

http://www.cnblogs.com/sayou/p/3319635.html



------------------------------------------------------------------------------------

买了一个域名

现在可以通过http://oblivious.top/直接进入我nginx的网页

当然因为没有备案,已经gg了


---------------------------------------------------------------------------------------------------------

看了点正则表达式感觉头有点晕


写了点关于统计访问次数和时间的脚本 但是一直不得要领

等写好再贴


遇到的问题

收获


返回列表 返回列表
评论

    分享到