fix install script to work with unicorn

This commit is contained in:
dobacco
2013-04-17 12:03:34 -07:00
committed by dovac
parent 60617c7c81
commit 00908a7ace
4 changed files with 58 additions and 457 deletions

25
script/install/nginx.danbooru.conf Executable file → Normal file
View File

@@ -1,11 +1,10 @@
server {
passenger_enabled on;
listen 80;
server_name __hostname__;
root /var/www/danbooru/current/public;
root /var/www/danbooru2/current/public;
index index.html;
access_log /var/log/www/danbooru.access.log;
error_log /var/log/www/danbooru.error.log;
access_log /var/log/nginx/danbooru.access.log;
error_log /var/log/nginx/danbooru.error.log;
client_max_body_size 30m;
location /stylesheets {
expires max;
@@ -30,6 +29,22 @@ server {
rewrite ^(.*)$ /maintenance.html last;
break;
}
location @app_server {
proxy_pass http://app_server;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Proto http;
}
location / {
try_files $uri @app_server;
}
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
}
}
upstream app_server {
server 127.0.0.1:9000;
}