博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nginx配置摘要
阅读量:7171 次
发布时间:2019-06-29

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

hot3.png

nginx.conf:

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;

client_max_body_size 10M;

    #gzip  on;

    #加载配置顺序 靠前采用域名地址   

    #include       d:/wnmp/nginx-1.4.3/conf/vhost/test.conf;

#include       d:/wnmp/nginx-1.4.3/conf/vhost/ci.conf;

include       D:/wnmp/nginx-1.4.3/conf/vhost/*.conf;

}

vhost文件夹下的一个服务器配置

    server {

        listen       80;

        server_name  tczsslocal.com;

        location / {

            root   d:/wnmp/tczsslocal;

            index  index.php index.html index.htm;

if ( -d $request_filename){

rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;

}

if ( !-e $request_filename){

rewrite ^/(.*) /?v=$1 break;

}

        }

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        }

        location ~ \.php$ {

root   d:/wnmp/tczsslocal;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  d:/wnmp/tczsslocal$fastcgi_script_name;

            include        fastcgi_params;

include   d:/wnmp/nginx-1.4.3/conf/fastcgi.conf;

        }

    }

转载于:https://my.oschina.net/u/1029242/blog/340522

你可能感兴趣的文章
bash 脚本编程 变量、变量类型 (笔记)
查看>>
win7 管理员权限
查看>>
docker下redis集群搭建
查看>>
composer出现proc_open,fileinfo问题
查看>>
无ROWID优化(The WITHOUT ROWID Optimization)
查看>>
Android第七课 探索Activity的生命周期
查看>>
求排列
查看>>
Cisco-CCNP之OSPF链路状态路由协议(三)
查看>>
CentOS 7 系列(一)系统服务 systemd
查看>>
Hive 数据倾斜总结
查看>>
mysql查询结果处理
查看>>
扫描识别控件Dynamic Web TWAIN v12.3.1发布,更新服务证书丨附下载
查看>>
VintaSoft PDF插件VintaSoftPDF.NET Plug-in更新至v5.6,新增多页查看模式
查看>>
windows环境中不重启电脑杀死占用某个端口的进程
查看>>
“90+68”的完美转变
查看>>
Kubernetes上的负载均衡详解
查看>>
centos7格式化大于2T的硬盘
查看>>
为什么要进行项目总结呢?又如何进行项目总结呢?
查看>>
iOS——重写Cell分割线
查看>>
window与linux下,php的redis扩展安装
查看>>