## Default configuration for NGINX running on ABQAP16
user  nginx;
worker_processes  3;
worker_cpu_affinity 0010 0100 1000;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    # multi_accept on;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    log_format  gzip  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$host" $gzip_ratio';

    access_log  /var/log/nginx/server-access.log  main;
    access_log  /var/log/nginx/gzip-access.log  gzip;

	##
	# Basic Settings
	##
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# Prevent Server Information Disclosure
	server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	##
	# Temporary Files and Cache paths
	##
	client_body_temp_path /var/lib/nginx/body 2;
	proxy_temp_path /var/lib/nginx/proxy 2;
	proxy_cache_path /var/www/proxy-cache keys_zone=backend-cache:8m;

	##
	# SSL Settings
	##
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	ssl_certificate /etc/nginx/ssl/atars.net_gdig2.pem.exp20250522.crt;
	ssl_certificate_key /etc/nginx/ssl/atars.net.pem.key;
	ssl_verify_client on;
	ssl_verify_depth 2;
	ssl_client_certificate /etc/nginx/ssl/DoD_CAs.pem;
	ssl_dhparam /etc/nginx/ssl/dhp-2048.pem;
	ssl_session_cache shared:SSL:10m;
	ssl_session_tickets on;
	ssl_session_timeout 1h;
	ssl_protocols TLSv1.2;
	#ssl_ciphers "ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!AES256";
	ssl_ciphers "HIGH:!aNULL:!MD5:!3DES";
	ssl_prefer_server_ciphers on;

	##
	# Gzip Settings
	##
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	gzip off; 
	gzip_disable "msie6";
	gzip_vary on;
	gzip_proxied any;
	gzip_comp_level 6;
	gzip_buffers 8 26k;
	gzip_min_length 512;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Virtual Host Configs
	##
	include /etc/nginx/conf.d/*.conf;
	#include /etc/nginx/sites-enabled/*;
}

#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
# 
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}
