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が壊れたっぽい。