zoukankan      html  css  js  c++  java
  • nginx http*简单配置及systemd 配置

    #user  nobody;
    worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #pid        logs/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
        #                  '$status $body_bytes_sent "$http_referer" '
        #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
        #log_format upstreamlog '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time';
    
        log_format  main  '$status - $proxy_host "$request" $upstream_addr';
                          
       
    
        server
        {
            access_log  logs/access.log  main;
            listen 80;
            location /
            {
                proxy_pass   http://127.0.0.1:5000;
                proxy_read_timeout 9999;
            }
            location /api/fi/aa/v1.0/
            {
                proxy_pass   http://127.0.0.1:8080;
                proxy_read_timeout 9999;
            }
            location /api/fastdweb/runtime/v1.0/
            {
                proxy_pass   http://127.0.0.1:8080;
                proxy_read_timeout 9999;
            }
        }
           
    }
    [Unit]
    Description=The NGINX HTTP and reverse proxy server
    After=syslog.target network.target remote-fs.target nss-lookup.target
    
    [Service]
    Type=forking
    PIDFile=/run/nginx.pid
    ExecStartPre=/usr/sbin/nginx -t
    ExecStart=/usr/sbin/nginx
    ExecReload=/usr/sbin/nginx -s reload
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true
    
    [Install]
    WantedBy=multi-user.target

    参考:

    https://www.nginx.com/resources/wiki/start/topics/examples/systemd/

  • 相关阅读:
    各种编译器
    C99特性
    动态内存分配
    MDK C++编程说明
    C++类的大小计算
    WPF DataGrid添加编号列
    WPF实现打印用户界面功能
    WPF DataGrid 导出Excel
    知识点总结
    Winfrom控件使用
  • 原文地址:https://www.cnblogs.com/wolbo/p/11518624.html
Copyright © 2011-2022 走看看