Nginx伪静态配置和常用Rewrite伪静态规则集锦
nginx里使用伪静态是直接在nginx.conf中写规则的,并不需要像apache要开启写模块(mod_rewrite)才能进行伪静态。
nginx只需要打开nginx.conf配置文件,在server里面写需要的规则即可。
server
{
listen 80;
server_name bbs.jb51.net;
indexindex.htmlindex.htmindex.php;
root /home/www/bbs;
error_page 404 /404.htm; #配置404错误页面 location~.*.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_indexindex.php; includefcgi.conf; }
#下面就是伪静态了
location/{ rewrite^(.*)/equip(d+).html$$1/index.php?m=content&c=index&a=lists&catid=$2last; } access_log access_log off; }
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短