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. NX二次开发-UFUN打开信息窗口UF_UI_open_listing_window()

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> UF_initialize(); //方法1(uc1601) uc1601();// ...

  2. 高可用开源方案Heartbeat vs Keepalived

    转:http://www.kuqin.com/shuoit/20140623/340745.html 最近因为项目需要,简单的试用了两款高可用开源方案:Keepalived和Heartbeat.两者都 ...

  3. LeetCode 197. Rising Temperature (上升的温度)

    题目标签: 题目给了我们一个 温度表格,让我们找到 所有温度比之前一天高的,返回id. 建立 Weather w1, Weather w2,找到当w1 的温度 大于 w2 的时候,而且 w1 的日期是 ...

  4. idea 启动异常xxxx.local: nodename nor servname provided, or not known

    在host文件里面新增配置: 127.0.0.1 xxxx.local localhost 原文地址:https://www.jianshu.com/p/12e01fa9c69c

  5. Instrumentation 实践详解

    原文地址:https://blog.csdn.net/pengjunlee/article/details/72717622

  6. day28-描述符应用与类的装饰器

    #!/usr/bin/env python# -*- coding:utf-8 -*-# ------------------------------------------------------- ...

  7. 《DSP using MATLAB》Problem 9.4

    只放第1小题. 代码: %% ------------------------------------------------------------------------ %% Output In ...

  8. socket的多线程实现

    步骤: 1.服务端创建ServerSocket,循环调用accept()等待客户端连接: 2.客户端创建socket并请求与服务端对话: 3.服务端接收客户端的请求,创建socket与客户端进行专线连 ...

  9. 003-JavaString数据类型

    String类型可以和8中基本数据类型做运算(byte/short/char/int/long/float/double/boolean),且只能是连接运算 1. 区分 连接符 和 “+” 的区别 c ...

  10. StringBuilder 和 StringBuffer类

    通常在涉及到StringBuilder和StringBuffer时中任何一个时,都应该想到另外一个并且在脑海中问自己是否用另外一个更加合适. 为什么这么说,请继续往下看,当然如果你已经对二者烂熟于胸自 ...