zoukankan      html  css  js  c++  java
  • 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;
  • 相关阅读:
    [原创]在Windows平台使用msvc(cl.exe) + vscode编写和调试C/C++代码
    几种动态调用js函数方案的性能比较
    z-index随笔
    [原]配置多个密钥免密码登录服务器简明教程
    [转]为 windows cmd 设置代理
    [原创]实现多层DIV叠加的js事件穿透
    [转]linux terminal中使用proxy
    [转]jquery中innerWidth(),outerWidth(),outerWidth(true)和width()的区别
    [转]React表单无法输入原因----约束性和非约束性组件
    [原创]aaencode等类似js加密方案破解方法
  • 原文地址:https://www.cnblogs.com/ecstore/p/3187456.html
Copyright © 2011-2022 走看看