2015-07-20 00:09:47 -07:00
|
|
|
user www-data;
|
|
|
|
|
|
|
|
|
|
worker_processes 1;
|
|
|
|
|
|
|
|
|
|
pid /run/nginx.pid;
|
|
|
|
|
|
|
|
|
|
events {
|
|
|
|
|
worker_connections 1024;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
http {
|
|
|
|
|
include mime.types;
|
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
|
|
# the collectd config depends on this log format
|
|
|
|
|
log_format combined2 '$remote_addr - [$time_local] '
|
|
|
|
|
'"$request" $status $body_bytes_sent $request_time '
|
|
|
|
|
'"$http_referer" "$http_user_agent"';
|
|
|
|
|
|
2015-07-23 13:54:57 -07:00
|
|
|
# required for long host names
|
2015-07-23 14:30:15 -07:00
|
|
|
server_names_hash_bucket_size 128;
|
2015-07-23 13:54:57 -07:00
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
access_log access.log combined2;
|
|
|
|
|
|
|
|
|
|
sendfile on;
|
|
|
|
|
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
|
|
# HTTP server
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
|
|
|
|
|
# collectd
|
|
|
|
|
location /nginx_status {
|
|
|
|
|
stub_status on;
|
|
|
|
|
access_log off;
|
|
|
|
|
allow 127.0.0.1;
|
|
|
|
|
deny all;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-08 19:04:48 -08:00
|
|
|
# acme challenges
|
|
|
|
|
location /.well-known/acme-challenge/ {
|
2015-12-09 18:34:13 -08:00
|
|
|
default_type text/plain;
|
2015-12-08 19:04:48 -08:00
|
|
|
alias /home/yellowtent/data/acme/;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
location / {
|
|
|
|
|
# redirect everything to HTTPS
|
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# We have to enable https for nginx to read in the vhost in http request
|
|
|
|
|
# and send a 404. This is a side-effect of using wildcard DNS
|
|
|
|
|
server {
|
|
|
|
|
listen 443 default_server;
|
|
|
|
|
ssl on;
|
|
|
|
|
ssl_certificate cert/host.cert;
|
|
|
|
|
ssl_certificate_key cert/host.key;
|
|
|
|
|
|
2016-01-22 19:28:40 +01:00
|
|
|
# increase the proxy buffer sizes to not run into buffer issues (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers)
|
|
|
|
|
proxy_buffer_size 128k;
|
|
|
|
|
proxy_buffers 4 256k;
|
|
|
|
|
proxy_busy_buffers_size 256k;
|
|
|
|
|
|
|
|
|
|
# Disable check to allow unlimited body sizes
|
|
|
|
|
client_max_body_size 0;
|
|
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
error_page 404 = @fallback;
|
|
|
|
|
location @fallback {
|
|
|
|
|
internal;
|
2015-12-10 13:54:53 -08:00
|
|
|
root /home/yellowtent/box/webadmin/dist;
|
2015-07-20 00:09:47 -07:00
|
|
|
rewrite ^/$ /nakeddomain.html break;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-22 19:28:40 +01:00
|
|
|
location / {
|
|
|
|
|
internal;
|
|
|
|
|
root /home/yellowtent/box/webadmin/dist;
|
|
|
|
|
rewrite ^/$ /nakeddomain.html break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /api/ {
|
|
|
|
|
proxy_pass http://127.0.0.1:3000;
|
|
|
|
|
client_max_body_size 1m;
|
|
|
|
|
}
|
2015-07-20 00:09:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
include applications/*.conf;
|
|
|
|
|
}
|
|
|
|
|
|