1
0
Fork 0

Add pastekitten.com domain

This commit is contained in:
Gregory Eremin 2013-07-25 16:42:54 +07:00
parent 897fa2d3cb
commit 78aed88570
2 changed files with 13 additions and 2 deletions

View File

@ -3,8 +3,9 @@ upstream pastekitten_unicorns {
} }
server { server {
listen pm.localhots.xxx:80; listen pastekitten.com:80;
server_name pm.localhots.xxx; server_name pastekitten.com www.pastekitten.com pm.localhots.xxx;
root /home/www/apps/pastekitten/current; root /home/www/apps/pastekitten/current;
client_max_body_size 10M; client_max_body_size 10M;
keepalive_timeout 5; keepalive_timeout 5;

View File

@ -51,6 +51,10 @@ class Pastekitten < Sinatra::Application
css_compression :simple css_compression :simple
end end
before do
correct_domain_name
end
get '/' do get '/' do
@syntaxes = CONFIG.syntaxes_map @syntaxes = CONFIG.syntaxes_map
@ -78,4 +82,10 @@ class Pastekitten < Sinatra::Application
forbidden forbidden
end end
end end
def correct_domain_name
if %w[ www.pastekitten.com pm.localhots.xxx ].include?(request.host)
redirect 'http://pastekitten.com' + request.fullpath
end
end
end end