全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2010|回复: 7

[疑问] nginx的伪静态规则应该怎么来加?

[复制链接]
发表于 2010-12-8 23:40:01 | 显示全部楼层 |阅读模式
网站程序的.htaccess 内容为
RewriteEngine on
RewriteBase /
RewriteRule  ^view/(.*)/(.*)  view\.php\?id=$1&pg=$2
RewriteRule  ^view/(.*).htm$  view\.php\?id=$1
RewriteRule  ^art/(.*).htm$  art\.php\?id=$1

转换后的代码为
rewrite / ^/view/(.*)/(.*);
rewrite / ^/view/(.*).htm$;
rewrite / ^/art/(.*).htm$;

VPS的配置使用 lnmp1.5配置的  这个伪静态规则怎么来加呢?加到什么位置?
/usr/local/nginx/conf  下面的nginx.conf 里面么?
nginx.conf 代码如下:
user  www www;
worker_processes 1;
error_log  /home/www/logs/nginx_error.log  crit;
pid        /usr/local/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 1024;
events
        {
                use epoll;
                worker_connections 1024;
        }
http
        {
                include       mime.types;
                default_type  application/octet-stream;
                #charse  gb2312;
                server_names_hash_bucket_size 128;
                client_header_buffer_size 128k;
                large_client_header_buffers 4 256k;
                client_max_body_size 16m;
                sendfile on;
                tcp_nopush     on;
                keepalive_timeout 60;
                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 128k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.1;
                gzip_comp_level 9;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;
                output_buffers   4 32k;
                postpone_output  1460;

                #limit_zone  crawler  $binary_remote_addr  10m;        
               
server
        {
                listen       80;
                server_name www.qqyxi.com;
                index index.html index.htm index.php;
                include location.conf;
                root  /home/www;
        }
                include servers/*;
}



还是 /usr/local/nginx/conf/servers  下面的 incat.conf 里面?
incat.conf 的代码如下:

server

        {
                listen       80;
                server_name imcat.in;
                index index.html index.htm index.php;
                root  /home/www/imcat;
                include location.conf;
                include wordpress.conf;
        }


麻烦哪位帮我加一下 怎么来加啊?
发表于 2010-12-8 23:40:20 | 显示全部楼层
抢沙发偶吔!
发表于 2010-12-8 23:40:37 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2010-12-8 23:44:22 | 显示全部楼层
按照我一般的做法,就加到网站根目录下然后:
include /home/www/imcat/url_rewrite.conf
发表于 2010-12-8 23:47:59 | 显示全部楼层
原帖由 Administrator 于 2010-12-8 23:40 发表
/usr/local/nginx/conf/servers 这里的文件


签名里的网站是你的不?很好,很给力,支持一下。
 楼主| 发表于 2010-12-8 23:51:57 | 显示全部楼层

回复 4# 的帖子

网站 根目录 怎么加啊? 一点都不懂



就是用的你那里的VPS pnvps.com 的
 楼主| 发表于 2010-12-8 23:55:39 | 显示全部楼层

回复 3# 的帖子

/usr/local/nginx/conf/servers  下面的 incat.conf 里面

这个下面只有一个 文件  就是  incat.conf   文件
代码是

server

        {
                listen       80;
                server_name imcat.in;
                index index.html index.htm index.php;
                root  /home/www/imcat;
                include location.conf;
                include wordpress.conf;
        }

我的伪静态规则怎么加到里面去啊 我不知道加
发表于 2010-12-11 15:59:18 | 显示全部楼层
呵呵,我也不知道怎么样加。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-6-27 16:48 , Processed in 0.079042 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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