worker_processes auto;
pid /run/nginx.pid;

events {
    worker_connections 1024;
}

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

    # Security issue: server tokens on
    server_tokens on;

    # No security headers configured

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    server {
        listen 80;
        server_name example.com;

        root /var/www/html;
        index index.html;

        # Security issue: directory listing enabled
        autoindex on;

        location / {
            try_files $uri $uri/ =404;
        }

        location /uploads {
            # Security issue: no upload size limit
            client_max_body_size 0;
        }
    }

    server {
        listen 443 ssl;
        server_name example.com;

        # Security issue: weak SSL protocols
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_certificate /etc/ssl/certs/example.crt;
        ssl_certificate_key /etc/ssl/private/example.key;

        # Security issue: weak ciphers allowed
        ssl_ciphers ALL:!aNULL:!eNULL;

        root /var/www/html;
        index index.html;

        location / {
            try_files $uri $uri/ =404;
        }
    }
}
