最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

WordPress與Drupal的Nginx配置rewrite重寫規(guī)則示例

 更新時(shí)間:2016年01月13日 17:54:09   投稿:goldensun  
這篇文章主要介紹了WordPress與Drupal的Nginx配置重寫規(guī)則示例,文中介紹的rewrite寫法簡(jiǎn)單而突出配置重點(diǎn),需要的朋友可以參考下

WordPress

wordpress依然是目前是世界上最流行的博客系統(tǒng),越來越多由wordpress搭建而成的網(wǎng)站在使用nginx服務(wù)器軟件,這里就來分享一下WordPress的nginx重寫規(guī)則:
 

  server {
    listen    80;
    server_name m.fzitv.net jb51.net;
    access_log /data/logs/nginx/m.fzitv.net.access.log main;
 
    index index.html index.php;
    root /data/site/m.fzitv.net;
location / {
    try_files $uri $uri/ /index.php?$args;
    add_header Pragma "public";
    expires 12h;
}
 
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
 
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
    access_log off;
      log_not_found off;
      expires max;
}
 
 
location ~ \.php$ {
    try_files $uri =404;
 
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
 
    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#    fastcgi_intercept_errors on;
    fastcgi_pass 127.0.0.1:9000;
}
 
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
    expires 24h;
    access_log off;
}
 
location ~ .*\.(js|css)$
{
    expires 24h;
    access_log off;
}

 重啟你的nginx即可

Drupal nginx重寫規(guī)則
Drupal是使用PHP語(yǔ)言編寫的開源內(nèi)容管理框架,就是俗稱的CMS,很多人在用Drupal搭建自己的博客,這里也來分享一下Drupal的nginx重寫規(guī)則:

server {
 ...
location / {
 # This is cool because no php is touched for static content
 try_files $uri @rewrite;
 }
location @rewrite {
 # Some modules enforce no slash (/) at the end of the URL
 # Else this rewrite block wouldn't be needed (GlobalRedirect)
 rewrite ^/(.*)$ /index.php?q=$1;
 }
location ~ \.php$ {
 fastcgi_split_path_info ^(.+\.php)(/.+)$;
 #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
 include fastcgi_params;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_intercept_errors on;
 fastcgi_pass unix:/tmp/phpfpm.sock;
 }
...
 }

 
重啟nginx

相關(guān)文章

最新評(píng)論

海阳市| 化隆| 中方县| 故城县| 云林县| 巴塘县| 临高县| 长子县| 翼城县| 防城港市| 奎屯市| 禹州市| 馆陶县| 来宾市| 客服| 浏阳市| 当雄县| 凉山| 洮南市| 原阳县| 洛扎县| 建德市| 体育| 乐都县| 涞水县| 永年县| 新宾| 黔西| 丹东市| 高阳县| 大兴区| 井研县| 岳阳市| 台前县| 南京市| 新源县| 九龙坡区| 伊吾县| 稻城县| 虎林市| 重庆市|