servnest-mkosi/mkosi.extra/etc/nginx/nginx.conf

54 lines
1.4 KiB
Nginx Configuration File

load_module "/usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so";
worker_processes auto;
user nginx nginx;
events {
worker_connections 1024;
}
http {
types_hash_bucket_size 128;
types_hash_max_size 1024;
server_names_hash_bucket_size 128;
# Performance optimisation
sendfile on;
tcp_nopush on;
# Correct Content-Type header
charset utf-8;
default_type text/plain;
include inc/types.conf;
# Serve file.gz instead of file if available
gzip_static on;
# Logging
log_format niver '|$time_local| [$remote_addr]@$server_name {$ssl_protocol $ssl_cipher} $status $body_bytes_sent "$request" "$http_user_agent"';
access_log /var/log/nginx/access.log niver;
error_log /var/log/nginx/error.log notice;
# Disable useless/dangerous features
etag off;
server_tokens off;
more_clear_headers Server;
# Basic security headers
more_set_headers "Referrer-Policy : no-referrer";
more_set_headers "Strict-Transport-Security : max-age=94608000; includeSubDomains; preload";
more_set_headers "X-Content-Type-Options : nosniff";
#more_set_headers "X-XSS-Protection : 1; mode=block";
#more_set_headers "X-Download-Options : noopen";
#more_set_headers "X-Permitted-Cross-Domain-Policies : none";
#more_set_headers "X-Frame-Options : DENY";
# Basic TLS settings
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# Include other configuration
include sites/*.conf;
include /srv/niver/nginx/*.conf;
}