Created
December 29, 2013 06:45
-
-
Save igaiga/8168084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream tdiary.unicorn { | |
server localhost:8080; | |
} | |
server { | |
server_name igarashikuniaki.net; | |
access_log /var/log/nginx/localhost.access.log; | |
location / { | |
root /var/www/; | |
index index.html index.htm; | |
} | |
location = / { | |
rewrite ^ /diary/ redirect; | |
} | |
location = /diary { | |
rewrite ^ /diary/ redirect; | |
} | |
location = /tdiary { | |
rewrite ^ /diary/ redirect; | |
} | |
location ~ ^/tdiary { | |
rewrite ^/tdiary/(.*)$ /diary/$1 redirect; | |
} | |
location ~ ^/[0-9\-]+\.html$ { | |
rewrite ^ /diary$request_uri redirect; | |
} | |
location ~ ^/diary/ { | |
try_files $uri @unicorn; | |
} | |
location @unicorn { | |
rewrite /diary/([0-9\-]+)\.html$ /diary/index.rb?date=$1 last; | |
proxy_pass http://tdiary.unicorn; | |
} | |
} | |
server { | |
server_name www.igarashikuniaki.net; | |
rewrite ^ $scheme://igarashikuniaki.net$request_uri redirect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment