java-nginx

基本命令

帮助命令:nginx -h
版本命令:nginx -v
编译命令:nginx -V
启动命令: ./nginx
查看进程: ps aux | grep nginx
检查配置文件:sudo nginx -t
指定启动配置文件:sudo nginx -c /usr/local/nginx/conf/nginx.conf
暴力停止服务:sudo nginx -s stop
优雅停止服务:sudo nginx -s quit
重新加载配置文件:sudo nginx -s reload

源码编译

./configure --prefix=/home/fdfs/nginx_bin --add-module=/home/yuqing/fastdfs-nginx-module/src
make&&make install

配置文件

nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$time_local | $host | $status | $request_length | $bytes_sent | $upstream_addr | $upstream_response_time | '
                      '$http_referer | $remote_addr | $remote_user | $request | $request_uri | '
                      '$http_user_agent | $http_x_forwarded_for | $cookie_Mac';

    log_format  api_main  escape=json '$time_local | $host | $status | $request_length | $bytes_sent | $upstream_addr | $upstream_response_time | '
                      '$http_referer | $remote_addr | $remote_user | $request | '
                      '$http_user_agent | $http_x_forwarded_for | $cookie_Mac | $http_authorization | $request_body';

    access_log  /var/log/nginx/access.log  main;
    client_max_body_size     1024m;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   35;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    include /etc/nginx/conf.d/*.conf;
}

reco.conf

#upstream bms_nodes {
#        server 127.0.0.1:5000 weight=1; #权值越高分配几率越大
#}

server {
        # 监听端口号
    listen 3070;
    server_name 192.168.111.231;
    access_log /var/log/nginx/oa.log main;
    root /opt/html/reco;
    index index.html;

    location / {
       try_files $uri /index.html;
    }

   # location ~* html {
   #     rewrite .* /index.html break;
   #    root /opt/html/siyue;
   # }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值