• Ecstore Linux服务器环境基本配置


    Nginx基本配置(另存为nginx.conf直接可以使用):

    #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 {
            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  0;
            keepalive_timeout  65;
    
            #gzip  on;
    
            server {
                listen       80;
                server_name  localhost;
                root        e:/www;
    
                charset utf-8;
    
                access_log  logs/host.access.log;
    
                location / {
                    root        e:/www;
                    index  index.html index.htm index.php;
                    autoindex on;
                }
    
                #error_page  404              /404.html;
    
                # redirect server error pages to the static page /50x.html
                #
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                    root        e:/www;
                }
    
                # proxy the PHP scripts to Apache listening on 127.0.0.1:80
                #
                #location ~ .php$ {
                #    proxy_pass   http://127.0.0.1;
                #}
    
                # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
                #
                location ~ .php {
                    include        fastcgi_params;
                    set $path_info "";
                    set $real_script_name $fastcgi_script_name;
                    if ($fastcgi_script_name ~ "^(.+.php)(/.+)$") {
                        set $real_script_name $1;
                        set $path_info $2;
                    }
                    fastcgi_param SCRIPT_NAME $real_script_name;
                    fastcgi_param PATH_INFO $path_info;
                    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                }
    
                # deny access to .htaccess files, if Apache's document root
                # concurs with nginx's one
                #
                #location ~ /.ht {
                #    deny  all;
                #}
            }
        }
    

      网站根目录根据自己的情况修改;

    文件中以下代码是为了配置nginx解析"pathinfo"函数
    set $path_info "";
            set $real_script_name $fastcgi_script_name;
            if ($fastcgi_script_name ~ "^(.+.php)(/.+)$") {
            set $real_script_name $1;
            set $path_info $2;
            }
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
  • 相关阅读:
    Python-Jenkins 查询job是否存在
    关于QT
    编译C++程序
    Linux基础知识
    Ubuntu下安装QT
    Linux下的编辑器Notepadqq
    简单的说两句
    c之void及void*
    c之(类型)-1?
    c之枚举默认值
  • 原文地址:https://www.cnblogs.com/ecstore/p/3187456.html
Copyright © 2020-2023  润新知