国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Nginx > 正文

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

2024-08-30 12:26:21
字體:
供稿:網(wǎng)友

WordPress

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

  server {    listen    80;    server_name www.survivalescaperooms.com Vevb.com;    access_log /data/logs/nginx/www.survivalescaperooms.com.access.log main;     index index.html index.php;    root /data/site/www.survivalescaperooms.com;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語言編寫的開源內(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

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 辽中县| 南宫市| 叙永县| 神木县| 宁城县| 峨边| 平江县| 潞西市| 读书| 阜阳市| 普宁市| 佛山市| 桓仁| 上栗县| 龙井市| 资源县| 台山市| 潢川县| 东兰县| 达日县| 长顺县| 中山市| 桑日县| 襄汾县| 横山县| 东海县| 二连浩特市| 西乌珠穆沁旗| 东丽区| 永城市| 定安县| 革吉县| 柏乡县| 西宁市| 安西县| 安顺市| 贵南县| 乌兰察布市| 伊通| 南通市| 定边县|