1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/config/nginx_staging.conf

55 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-03-23 18:39:41 +01:00
upstream fablab_unicorn_staging {
server unix:/tmp/unicorn.fablab_staging.sock fail_timeout=0;
2015-05-05 03:10:25 +02:00
}
server {
listen 80;
2016-03-23 18:39:41 +01:00
server_name fablab.sleede.com capsciences.sleede.com relais-sciences.sleede.com demo-premium.fab-manager.com;
root /home/admin/apps/fablab_staging/current/public;
#location / {
# auth_basic "Restricted";
# auth_basic_user_file /home/admin/apps/fablab/.htpasswd;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_redirect off;
# proxy_pass http://unicorn;
#}
2015-05-05 03:10:25 +02:00
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
2016-03-23 18:39:41 +01:00
try_files $uri/index.html $uri @fablab_unicorn_staging;
location @fablab_unicorn_staging {
2015-05-05 03:10:25 +02:00
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
2016-03-23 18:39:41 +01:00
proxy_pass http://fablab_unicorn_staging;
2015-05-05 03:10:25 +02:00
}
client_max_body_size 4G;
keepalive_timeout 10;
2016-03-23 18:39:41 +01:00
error_page 500 502 504 /500.html;
error_page 503 @503;
# Return a 503 error if the maintenance page exists.
if (-f /home/admin/apps/fablab_staging/shared/system/maintenance.html) {
return 503;
}
location @503 {
# Serve static assets if found.
if (-f $request_filename) {
break;
}
# Set root to the shared directory.
root /home/admin/apps/fablab_staging/shared;
rewrite ^(.*)$ /system/maintenance.html break;
}
2015-05-05 03:10:25 +02:00
}