# Nginx Configuration for Custom PHP Framework
# Environment: {{ environment | upper }}
# Generated by Ansible - Do not edit manually

user {{ nginx_user }};
worker_processes {{ nginx_worker_processes }};
pid /run/nginx.pid;

# Load modules
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections {{ nginx_worker_connections }};
    multi_accept {{ nginx_multi_accept | ternary('on', 'off') }};
    use epoll;
}

http {
    # Basic Settings
    sendfile {{ nginx_sendfile | ternary('on', 'off') }};
    tcp_nopush {{ nginx_tcp_nopush | ternary('on', 'off') }};
    tcp_nodelay {{ nginx_tcp_nodelay | ternary('on', 'off') }};
    keepalive_timeout {{ nginx_keepalive_timeout }};
    keepalive_requests {{ nginx_keepalive_requests }};
    types_hash_max_size 2048;
    server_tokens {{ nginx_server_tokens | ternary('on', 'off') }};
    
    # Client Settings
    client_max_body_size {{ nginx_client_max_body_size }};
    client_body_timeout {{ nginx_client_body_timeout }};
    client_header_timeout {{ nginx_client_header_timeout }};
    send_timeout {{ nginx_send_timeout }};
    
    # MIME Types
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    
    # Logging Format
    log_format main {{ nginx_access_log_format | quote }};
    
    # Default Logging
    access_log /var/log/nginx/access.log main;
    error_log /var/log/nginx/error.log {{ nginx_error_log_level }};
    
    # Include additional configuration files
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}