Files
cloudron-box/setup/start/nginx/nginx.conf

66 lines
1.6 KiB
Nginx Configuration File
Raw Normal View History

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"';
# required for long host names
2015-07-23 14:30:15 -07:00
server_names_hash_bucket_size 128;
2017-07-18 21:49:12 -07:00
access_log /var/log/nginx/access.log combined2;
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;
# 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
# HTTP server
server {
listen 80;
2017-09-11 14:53:41 +02:00
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/ {
default_type text/plain;
alias /home/yellowtent/platformdata/acme/;
2015-12-08 19:04:48 -08:00
}
location / {
# redirect everything to HTTPS
return 301 https://$host$request_uri;
}
}
include applications/*.conf;
}