destoon采集论坛

 找回密码
 立即注册
查看: 47|回复: 1

一个NGINX实例,从生产环境里搬来的

[复制链接]

33

主题

46

回帖

369

积分

中级会员

Rank: 3Rank: 3

积分
369
发表于 2012-4-16 18:29:18 | 显示全部楼层 |阅读模式
一个NGINX实例,从生产环境里搬来的
server
              {
               listen       80;
                server_name chongqing.123.com cq.123.com;
                root   /var/www/123_chongqing;
                location / {
                index  index.html index.htm index.php;
                access_log off;
                }
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                root   html;
                }
                access_log  /var/log/nginx/Chongqing.log;
                location ~ \.php$ {
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    include        fastcgi_params;
                }
                rewrite ^/(.*)-htm-(.*)$ /$1.php?$2 last;
                rewrite ^/(.*)/show-([0-9]+)([\-])?([0-9]+)?\.html$ /$1/show.php?itemid=$2&page=$4 last;
                rewrite ^/(.*)/list-([0-9]+)([\-])?([0-9]+)?\.html$ /$1/list.php?catid=$2&page=$4 last;
                rewrite ^/(.*)/show/([0-9]+)/([0-9]+)?([/])?$ /$1/show.php?itemid=$2&page=$3 last;
                rewrite ^/(.*)/list/([0-9]+)/([0-9]+)?([/])?$ /$1/list.php?catid=$2&page=$3 last;
                rewrite ^(.*)/([a-z]+)/(.*)\.shtml$ $1/$2/index.php?rewrite=$3 last;
                rewrite ^/(com)/([a-z0-9_]+)/([a-z]+)/(.*)\.html$ /company/$3/index.php?homepage=$2&rewrite=$4 last;
                rewrite ^/(com)/([a-z0-9_]+)/([a-z]+)([/])?$ /company/$3/index.php?homepage=$2 last;
                rewrite ^/(com)/([a-z0-9_]+)([/])?$ /index.php?homepage=$2 last;
                location /status {
                stub_status on;
                access_log  off;
                }
        }

[ 本帖最后由 eelou 于 2012-4-16 18:30 编辑 ]
回复

使用道具 举报

9

主题

141

回帖

335

积分

中级会员

Rank: 3Rank: 3

积分
335
发表于 2012-4-17 11:39:55 | 显示全部楼层

不错,学习了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|destoon采集论坛

GMT+8, 2025-11-26 13:03 , Processed in 0.013711 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表