• 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;
  • 相关阅读:
    Lombok 安装、入门
    详细解析@Resource和@Autowired的区别 , 以及@Qualifier的作用
    Spring中@Resource与@Autowired、@Qualifier的用法与区别
    springMVC整合swagger
    jetty maven插件
    【原创】Sagger使用
    Eclipse详细设置护眼背景色和字体颜色
    eclipse中相同代码的高亮显示
    Mybatis分页插件
    mybatis
  • 原文地址:https://www.cnblogs.com/ecstore/p/3187456.html
Copyright © 2020-2023  润新知