zoukankan      html  css  js  c++  java
  • nginx 配置

    jrhwpt01:/root# netstat -nap | grep nginx
    tcp        0      0 0.0.0.0:8001                0.0.0.0:*                   LISTEN      23886/nginx         
    unix  3      [ ]         STREAM     CONNECTED     555259 23886/nginx         
    unix  3      [ ]         STREAM     CONNECTED     555258 23886/nginx         
    jrhwpt01:/root# 
    
    
    user  nginx;
    worker_processes  1;
    
    error_log   /var/log/nginx/nginx_error.log  crit;                   ---错误日志目录
    
    pid        /var/run/nginx.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" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        #access_log  logs/access.log  main;
    
        sendfile        on;
        tcp_nopush     on;
    
        keepalive_timeout  65;
    
        #gzip  on;
    
        server {
            listen       8001;
            server_name  localhost;
    
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
    
    
            location / {
    	    root /var/www/zjzc-web-frontEnd/;  ---静态资源地址
                index  index.html;
            }
    
    	location /nginx_status
            {
                    stub_status on;
                    access_log off;
            }
    
            error_page  404              /common/404.html;   --/var/www/zjzc-web-frontEnd/common/404.html
    
            # redirect server error pages to the static page /50x.html
            #
            #error_page   500 502 503 504  /50x.html;
            #location = /50x.html {
            #    root   html;
            #}
    
        }
    
    }
    
    启动停止:
    service nginx stop
    
    service nginx start
    
    
    http://120.26.44.206:8001/nginx_status
    
    Active connections: 3 
    server accepts handled requests
     250919 250919 251062 
    Reading: 0 Writing: 1 Waiting: 2 
    

  • 相关阅读:
    第33周二
    第33周一
    第32周日
    第32周六
    RichTextBox 右键显示 ContextMenuTrip
    关于 Head First SQL 中文版
    linux进程通信之共享内存
    chroot 与 jail
    SQL基础--> 约束(CONSTRAINT)
    MessageDigest简单介绍
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351708.html
Copyright © 2011-2022 走看看