zineからblogofileにしたのはいいんですが、blogofileは/log2配下にしていたため、リダイレクトをすることにしました。
/log2/path -> /blog/path

サンプル

#http://wiki.nginx.org/NginxHttpRewriteModule
location /download/ {
  rewrite  ^(/download/.*)/media/(.*)\..*$  $1/mp3/$2.mp3  break;
  rewrite  ^(/download/.*)/audio/(.*)\..*$  $1/mp3/$2.ra   break;
  return   403;
}

設定

でも、動作しない。。。なんで?ヽ(´Д`)

location /log2/ {     
    rewrite ^(/log2/)(.*) /blog/$2 break;    
    return 403;    
}

server_name?

よくわからんけど、server_nameを*で設定するといいらしい。。。目的のリダイレクトは達成されたから、一旦はok。でも、英語がわからへんねんなぁ。明日、よく良く読んでみよう。

#wikiから抜粋。
#Note that if a redirect is relative (has no host part), then when redirecting Nginx uses the "Host" header if the header match name of server_name directive or the first name of server_name directive, if the header does not match or is absent. If no server_name is set, then the local hostname is used. If you want Nginx to always use the "Host" header, you can use a wildcard "*" server_name (but see the restrictions on doing so). Example:

server_name  *;  

2011年10月16日 追記

server_nameを*で設定できないようになってますね。最初、設定したとき、シンタックスエラー出なかったのに。。。とりあえず、下記で対処しました。http://$Hostは、つけたくないのに。。。

server_name toenobu.name www.toenobu.name;

location /log2/ {     
    rewrite ^(/log2/)(.*) http://$Host/blog/$2 break;     
    return 403;     
}

virtualenvが壊れたっぽい。

« registrar, domain name server

Adventure, Stamina & Anger »

blog comments powered by Disqus

Categories

Uncategorized (rss) (2) | blogofile (rss) (2) | designpettern (rss) (3) | flask (rss) (2) | fluxflex (rss) (3) | java (rss) (6) | nginx (rss) (6) | python (rss) (8) | sacloud (rss) (3) | spdy (rss) (2) | thistownneedsguns (rss) (2) | webService (rss) (2) | zabbix (rss) (3) | さくらVPS (rss) (4) | 芸術は爆発しろ (rss) (3) |