• nginx的配置


    只是做个简单的记录

    # For more information on configuration, see: Official English Documentation: http://nginx.org/en/docs/
    
    #user nginx;
    user apache;
    worker_processes 16;
    worker_rlimit_nofile 65535;
    error_log /var/log/nginx/error.log;
    pid /run/nginx.pid;
    
    # Load dynamic modules. See /usr/share/nginx/README.dynamic.
    include /usr/share/nginx/modules/*.conf;
    
    events {
        use epoll;
    #    worker_connections 1024;
        worker_connections 20000;
        accept_mutex off;
        multi_accept off;
    }
    
    http {
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for" "$upstream_response_time"';
    
        access_log  /var/log/nginx/access.log  main;
        #error_log /var/log/nginx/error.log debug;
    
        server_tokens       off;
        sendfile            on;
        sendfile_max_chunk  512k;
        tcp_nopush          on;
        tcp_nodelay         on;
        keepalive_timeout   60 60;
        types_hash_max_size 2048;
        disable_symlinks    off;
    
        proxy_ignore_client_abort on;
    
        gzip on;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 5;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    
        include             /etc/nginx/mime.types;
        default_type        application/octet-stream;
    
        include /etc/nginx/conf.d/*.conf;
    
        server {
            listen       8081 default_server;
            listen       [::]:8081 default_server;
            #server_name  _;
            server_name_in_redirect off;
    
            root /usr/local/;
    
            # Load configuration files for the default server block.
            include /etc/nginx/default.d/*.conf;
    
            rewrite_log on;
    
            location / {
               root jessica/current/jessica/;
               index index.php;
               try_files $uri $uri/ /index.php?$uri&$args;
            }
    
            location /CodeIgniter-3.1.7 {
               index index.php;
               try_files $uri $uri/ /index.php?$uri&$args;
    
            }
    
            #location ~ /fdmall/((imgs|public|h5|asset)/(.+\.(css|js|jpg|jpeg|png|gif|bmp|swf).*)) {
            location ~ /fdmall/(.+\.(css|js|jpg|jpeg|png|gif|bmp|swf).*) {
                alias /usr/local/wxshop_v2/current/$1;
            }
            location  ~ /fdmall/(.+\.php.*)$ {
                if ($fastcgi_script_name ~ /fdmall/(.+\.php.*)$) {
                    set $valid_fastcgi_script_name $1;
                }
                alias /usr/local/wxshop_v2/current;
                index index.php;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param  SCRIPT_FILENAME  /usr/local/wxshop_v2/current/$valid_fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include  fastcgi_params;
            }
            location  = /fdmall/ {
                if ($fastcgi_script_name ~ /fdmall/(.+\.php.*)$) {
                    set $valid_fastcgi_script_name $1;
                }
                alias /usr/local/wxshop_v2/current;
                index index.php;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param  SCRIPT_FILENAME  /usr/local/wxshop_v2/current/$valid_fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include  fastcgi_params;
            }
    
            error_page 404 /404.html;
                location = /40x.html {
            }
    
            error_page 500 502 503 504 /50x.html;
                location = /50x.html {
            }
    
    
            location ~ \.php($|/) {
                fastcgi_pass   127.0.0.1:9000;
                #fastcgi_pass   unix:/dev/shm/fpm-cgi.sock;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                include fastcgi_params;
            }
    
            location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
                expires 30d;
            }
            location ~ .*\.(js|css)?$ {
                expires 30d;
            }  
        }
    
    }
    
  • 相关阅读:
    多网卡绑定
    deepin 20.2.3 数字时钟屏保
    (原创)odoo15(master)下,列表导出权限控制
    在CentOS7上扩容centos-root根目录
    Linux扩容-新增磁盘分区挂载-fdisk
    Docker
    隐私政策(URL)
    快排代码
    反射将对象所有属性(含集合中所有属性)中字符串类型做trim()
    Prometheus 查询语句
  • 原文地址:https://www.cnblogs.com/baolong/p/8638332.html
Copyright © 2020-2023  润新知