updated INSTALL script
This commit is contained in:
31
script/install/nginx.conf
Normal file
31
script/install/nginx.conf
Normal file
@@ -0,0 +1,31 @@
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
use epoll;
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
passenger_root /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8;
|
||||
passenger_ruby /usr/local/rvm/wrappers/default/ruby;
|
||||
passenger_enabled on;
|
||||
passenger_user_switching on;
|
||||
passenger_default_user danbooru;
|
||||
rails_spawn_method smart;
|
||||
passenger_max_pool_size 3;
|
||||
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
|
||||
gzip on;
|
||||
gzip_http_version 1.1;
|
||||
gzip_vary off;
|
||||
gzip_comp_level 6;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
gzip_buffers 16 8k;
|
||||
|
||||
include /opt/nginx/conf/sites/*.conf;
|
||||
}
|
||||
43
script/install/nginx.danbooru.conf
Normal file
43
script/install/nginx.danbooru.conf
Normal file
@@ -0,0 +1,43 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name $hostname;
|
||||
root /var/www/danbooru/public;
|
||||
index index.html;
|
||||
access_log /var/www/danbooru/log/server.access.log;
|
||||
error_log /var/www/danbooru/log/server.error.log;
|
||||
client_max_body_size 30m;
|
||||
location /stylesheets {
|
||||
expires max;
|
||||
break;
|
||||
}
|
||||
location /javascripts {
|
||||
expires max;
|
||||
break;
|
||||
}
|
||||
location /data {
|
||||
valid_referers none $hostname;
|
||||
if ($invalid_referer) {
|
||||
return 403;
|
||||
}
|
||||
expires max;
|
||||
break;
|
||||
}
|
||||
location /maintenance.html {
|
||||
expires 10;
|
||||
}
|
||||
if (-f $document_root/maintenance.html) {
|
||||
rewrite ^(.*)$ /maintenance.html last;
|
||||
break;
|
||||
}
|
||||
location / {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect false;
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://mongrel;
|
||||
}
|
||||
}
|
||||
error_page 404 /404.html;
|
||||
error_page 500 502 503 504 /500.html;
|
||||
}
|
||||
Reference in New Issue
Block a user