博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ecstore Linux服务器环境基本配置
阅读量:4948 次
发布时间:2019-06-11

本文共 2848 字,大约阅读时间需要 9 分钟。

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;

 

转载于:https://www.cnblogs.com/ecstore/p/3187456.html

你可能感兴趣的文章
静态方法是否属于线程安全
查看>>
fegin 调用源码分析
查看>>
Linux的基本命令
查看>>
02号团队-团队任务3:每日立会(2018-12-05)
查看>>
sql 语法大全
查看>>
SQLite移植手记1
查看>>
Java AmericanFlagSort
查看>>
Mysql远程连接报错
查看>>
C# windows程序应用与JavaScript 程序交互实现例子
查看>>
sqlServer去除字段中的中文
查看>>
HashMap详解
查看>>
Adobe Scout 入门
查看>>
51nod 1247可能的路径
查看>>
js05-DOM对象二
查看>>
mariadb BINLOG_FORMAT = STATEMENT 异常
查看>>
jq工具函数(九)使用$.extend()扩展Object对象
查看>>
如何监视性能和分析等待事件
查看>>
PAT 1058. 选择题(20)
查看>>
理解MapReduce计算构架
查看>>
python爬虫Day2:爬取豆瓣电影信息top250
查看>>