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

65 lines
1.6 KiB
Nginx Configuration File
Raw Normal View History

2015-05-05 03:10:25 +02:00
upstream unicorn {
2016-03-23 18:39:41 +01:00
server unix:/tmp/unicorn.fablab.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.lacasemate.fr fablab.ccsti-grenoble.org;
rewrite ^ https://fablab.lacasemate.fr$request_uri? permanent;
2015-05-05 03:10:25 +02:00
}
server {
listen 443 ssl;
2016-03-23 18:39:41 +01:00
server_name fablab.lacasemate.fr;
root /home/sleede/apps/fablab/current/public;
2015-05-05 03:10:25 +02:00
ssl on;
2016-03-23 18:39:41 +01:00
ssl_certificate /etc/nginx/ssl/certificate.fablab.lacasemate.fr.crt;
ssl_certificate_key /etc/nginx/ssl/fablab.lacasemate.fr.deprotected.key;
#location / {
# auth_basic "Restricted";
# auth_basic_user_file /home/sleede/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;
}
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unicorn;
}
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/sleede/apps/fablab/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/sleede/apps/fablab/shared;
rewrite ^(.*)$ /system/maintenance.html break;
}
2015-05-05 03:10:25 +02:00
}