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 '
|
2017-07-21 09:43:44 -07:00
|
|
|
'"$http_referer" "$host" "$http_user_agent"';
|
2015-07-20 00:09:47 -07:00
|
|
|
|
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
|
|
|
|
2017-07-18 21:49:12 -07:00
|
|
|
access_log /var/log/nginx/access.log combined2;
|
2015-07-20 00:09:47 -07:00
|
|
|
|
|
|
|
|
sendfile on;
|
|
|
|
|
|
2016-06-01 17:33:04 -07:00
|
|
|
# timeout for client to finish sending headers
|
|
|
|
|
client_header_timeout 30s;
|
|
|
|
|
|
|
|
|
|
# timeout for reading client request body (successive read timeout and not whole body!)
|
|
|
|
|
client_body_timeout 60s;
|
|
|
|
|
|
2016-06-01 16:51:52 -07:00
|
|
|
# keep-alive connections timeout in 65s. this is because many browsers timeout in 60 seconds
|
|
|
|
|
keepalive_timeout 65s;
|
2015-07-20 00:09:47 -07:00
|
|
|
|
2017-03-26 23:27:34 -07:00
|
|
|
# zones for rate limiting
|
2017-03-29 16:03:08 -07:00
|
|
|
limit_req_zone $binary_remote_addr zone=admin_login:10m rate=10r/s; # 10 request a second
|
2017-03-26 23:27:34 -07:00
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
|
2017-10-26 21:50:16 -07:00
|
|
|
# default http server that returns 404 for any domain we are not listening on
|
|
|
|
|
server {
|
|
|
|
|
listen 80 default_server;
|
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
|
server_name does_not_match_anything;
|
2015-12-08 19:04:48 -08:00
|
|
|
|
2017-11-02 11:29:51 -07:00
|
|
|
# acme challenges (for app installation and re-configure when the vhost config does not exist)
|
2017-10-28 23:30:12 -07:00
|
|
|
location /.well-known/acme-challenge/ {
|
|
|
|
|
default_type text/plain;
|
|
|
|
|
alias /home/yellowtent/platformdata/acme/;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
location / {
|
2017-10-26 21:50:16 -07:00
|
|
|
return 404;
|
2015-07-20 00:09:47 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
include applications/*.conf;
|
|
|
|
|
}
|