server {

listen 9090;

server_name i.com;

root /Users/chong/Documents/www;

# Load configuration files for the default server block.

location / {

index index.php index.html index.htm;

if (!-e $request_filename) {

#rewrite ^/index.php(.*)$ /index.php?s=$1 last;

#rewrite ^/admin.php(.*)$ /admin.php?s=$1 last;

#rewrite ^(.*)$ /index.php?s=$1 last;

#rewrite ^(.*)$ /admin.php?s=$1 last;

#rewrite '^/admin.php(.*)$' /data.txt last;

#rewrite ^/images/(.*)_(\d+)x(\d+)\.(png|jpg|gif)$ /data.txt last;

rewrite ^/php/midou/admin.php(.*)$ /php/midou/admin.php?s=$1 last; #ok...

#rewrite ^/(.*) http://xy2.163.com permanent; #ok...

break;

}

autoindex on;

autoindex_exact_size on;

autoindex_localtime on;

}

location ~* \.php$ {

fastcgi_index index.php;

fastcgi_pass 127.0.0.1:9001;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

server {

listen 9090;

server_name i.com;

root /Users/chong/Documents/www;

# Load configuration files for the default server block.

location / {

index index.php index.html index.htm;

if (!-e $request_filename) {

rewrite ^/(.*)/index.php(.*)$ /$1/index.php?s=$2 last;

rewrite ^/(.*)/admin.php(.*)$ /$1/admin.php?s=$2 last; #ok...

#rewrite ^/(.*) http://xy2.163.com permanent; #ok...

break;

}

autoindex on;

autoindex_exact_size on;

autoindex_localtime on;

}

location ~* \.php$ {

fastcgi_index index.php;

fastcgi_pass 127.0.0.1:9001;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

补充:

代理对文件大小的限制,

server {
client_max_body_size 100M;
listen 9096;
server_name gate.chaohuoyy.com;

location / {
proxy_pass http://127.0.0.1/data/index.html;
}

location /svn {
proxy_pass http://192.168.1.95:8080/svn;
}

}

nginx i.com.conf的更多相关文章

  1. 配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7

    在配置nginx 虚拟机时,执行 sudo /usr/sbin/nginx -t 报下面的错误: nginx: [emerg] nginx: configuration file /etc/nginx ...

  2. 阿里云centOS7.4 nginx: [emerg] "server" directive is not allowed here in /etc/nginx/vhost/xxxxxx.conf:2

    里云centOS7.4配置多个站点遇到的问题nginx: [emerg] "server" directive is not allowed here in /etc/nginx/ ...

  3. [root@offical nginx]# nginx -t nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_geoip_module.so" version 1012002 instead of 1016001 in /usr/share/nginx/modules/mod-http-geoip.conf:1 nginx: con

    [root@offical nginx]# nginx -tnginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_geoip_mo ...

  4. nginx配置文件httpd.conf详解

     PS:Nginx使用有两三年了,现在经常碰到有新用户问一些很基本的问题,我也没时间一一回答,今天下午花了点时间,结合自己的使用经验,把Nginx的主要配置参数说明分享一下,也参考了一些网络的内容,这 ...

  5. 《亲测》nginx webscoket ssl conf配置示例

    非crt证书,用的pem,其中 http://localhost:5003 是你要转发到的站点网址 配置的就是 server { listen 80; server_name smarthome.yi ...

  6. nginx新建nginx_fzjh.conf文件,不使用默认配置文件

    worker_processes 4; events{ worker_connections 1024; } http{ server { listen 80; server_name myserve ...

  7. nginx 分离配置文件 conf.d和default.conf

    1. 在 nginx.conf 文件中引用 conf.d 下的所有配置文件 #在http配置节的末尾添加配置引用 http { ... #gzip on; include /etc/nginx/con ...

  8. Nginx 加载conf.d (内文件***.conf)

    include /usr/local/nginx/conf/conf.d/*.conf;

  9. nginx 的一个conf配置

    server { listen 80 default_server; server_name www.caipudq.cn caipudq.cn *.caipudq.cn; root /mnt/www ...

随机推荐

  1. 玩转gulp之watch监听文件自动编译

    博客移至 https://www.dodoblog.cn/blog?id=5befc928e0feb34495b57035 我们在写页面的时候,用到sass less等css预处理器的时候,虽然写的很 ...

  2. Python中的startswith和endswith函数使用实例

    Python中的startswith和endswith函数使用实例 在Python中有两个函数分别是startswith()函数与endswith()函数,功能都十分相似,startswith()函数 ...

  3. hexo next主题深度优化(八),微加速

    个人博客:https://mmmmmm.me 源码:https://github.com/dataiyangu/dataiyangu.github.io 通过不断地上网查资料,引用的js.css.图片 ...

  4. 使用Beyond Compare作为Perforce默认的文件比较工具

    使用perforce自带的文件比较工具有时候会遇到乱码的情况,如下: 暂时不知道如何解决上述问题,因此想换个文件比对工具,比如Beyond Compare. 设定位置:Edit->prefere ...

  5. RCC, Reset and Clock Control

  6. 剑指offer——18打印从1到最大的n位数

    题目: 输入数字n,按顺序打印出从1到最大的n位十进制数.比如输入3,则打印出1.2.3一直到最大的3位数999. 题解: 注意大数溢出问题,故使用字符串更靠谱 class Solution { pu ...

  7. 54Mbps、150Mbps、433Mbps 你知道这三个Wi-Fi速率怎么算的吗?

           802.11g能够提供54Mbps的最大速率, 802.11n和802.11ac单流分别能够提供150Mbps和433Mbps的最大速率,这些数字是怎么算的呢?(看红字,更容易理解哟) ...

  8. Rabbit MQ 基础入门

    Rabbit MQ 学习(一)基础入门 简介 RabbitMQ 简介 为什么选择 RabbitMQ RabbitMQ 的模型架构是什么? AMQP 协议是什么? AMQP 常用命令 概念 生产者和消费 ...

  9. linux下使用scp在服务器之间拷贝文件 (转载)

    CentOS, 本地服务器,ip: 192.168.1.111Ubuntu, 远程服务器,ip: 192.168.1.112 1.拷贝远程服务器的目录到本地服务器远程服务器192.168.1.112上 ...

  10. C++之数据类型--整形&sizeof关键字

    数据类型: C++规定在创建一个变量或者常量时,必须要指定出相应的数据类型,否则无法给变量分配内存 整型 **作用**:整型变量表示的是==整数类型==的数据 C++中能够表示整型的类型有以下几种方式 ...