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 
    

  • 相关阅读:
    C#创建资源文件
    C#基础-获得当前程序的 空间名.类名.方法名
    C# 事务
    sql作业
    获取IP和mac地址
    winform文本框不能粘贴、复制和屏蔽右键
    Linux的iptables常用配置范例(1)
    自动化运维工具Ansible详细部署
    rsync+inotify实现数据的实时备份
    leetCode(26):Unique Binary Search Trees
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351708.html
Copyright © 2011-2022 走看看