1
0
Fork 0

Unicorn and Nginx configs

This commit is contained in:
Gregory Eremin 2013-07-12 17:54:08 +07:00
parent ce91297ee0
commit 9dc851b95e
3 changed files with 26 additions and 5 deletions

14
config/nginx.conf Normal file
View File

@ -0,0 +1,14 @@
server {
listen pm.localhots.xxx:80;
server_name pm.localhots.xxx;
root /home/www/apps/pastemaster/current;
location ^~ /public/ {
gzip_static on;
add_header Cache-Control public;
}
try_files $uri;
client_max_body_size 10M;
keepalive_timeout 10;
}

9
config/unicorn.rb Normal file
View File

@ -0,0 +1,9 @@
working_directory '/home/www/apps/pastemaster/current'
worker_processes 2
timeout 10
listen '/tmp/pastemaster.unicorn.sock', backlog: 64
pid '/tmp/pastemaster.unicorn.pid'
stderr_path '/dev/null'
stdout_path '/dev/null'

View File

@ -27,8 +27,11 @@ class Pastemaster < Sinatra::Application
set :server, 'unicorn' set :server, 'unicorn'
set :public_folder, 'public' set :public_folder, 'public'
set :views, File.expand_path('../app/views', __FILE__) set :views, File.expand_path('../app/views', __FILE__)
set :slim, pretty: true
register Sinatra::AssetPack register Sinatra::AssetPack
use ErrorPages
helpers ErrorPages::Forbidden
assets do assets do
serve '/assets/js', from: 'app/assets/js' serve '/assets/js', from: 'app/assets/js'
@ -48,11 +51,6 @@ class Pastemaster < Sinatra::Application
css_compression :simple css_compression :simple
end end
set :slim, pretty: true
use ErrorPages
helpers ErrorPages::Forbidden
get '/' do get '/' do
@syntaxes = CONFIG.syntaxes_map @syntaxes = CONFIG.syntaxes_map