Repository: digitalocean/nginxconfig.io
File: src/nginxconfig/generators/conf/nginx.conf.js (JavaScript)

Code before:
    config.http.push(['types_hash_max_size', 2048]);
    config.http.push(['client_max_body_size', `${global.nginx.clientMaxBodySize.computed}M`]);

    config.http.push(['# MIME', '']);
    config.http.push(['include', 'mime.types']);
    config.http.push(['default_type', 'application/octet-stream']);

    // Cloudflare
    if (global.logging.cloudflare.computed) {
        config.http.push(['# Log Format', '']);
        config.http.push(['log_format', `cloudflare '$remote_addr - $remote_user [$time_local] '
        '"$request" $status $body_bytes_sent '
        '"$http_referer" "$http_user_agent" '
        ${global.logging.cfRay.computed ? '\'$http_cf_ray \'' : ''}
        ${global.logging.cfConnectingIp.computed ? '\'$http_cf_connecting_ip \'' : ''}
        ${global.logging.xForwardedFor.computed ? '\'$http_x_forwarded_for \'' : ''}
        ${global.logging.xForwardedProto.computed ? '\'$http_x_forwarded_proto \'' : ''}
        ${global.logging.trueClientIp.computed ? '\'$http_true_client_ip \'' : ''}
        ${global.logging.cfIpCountry.computed ? '\'$http_cf_ipcountry \'' : ''}
        ${global.logging.cfVisitor.computed ? '\'$http_cf_visitor \'' : ''}
        ${global.logging.cdnLoop.computed ? '\'$http_cdn_loop \'' : ''}
        `]);
    }

    config.http.push(['# Logging', '']);
    config.http.push(['access_log', global.logging.accessLog.computed.trim() + `${global.logging.cloudflare.computed ? ' cloudflare' : ''}` || 'off']);
    config.http.push(['error_log', global.logging.errorLog.computed.trim() || '/dev/null']);

    if (global.security.limitReq.computed) {
        config.http.push(['# Limits', '']);
        config.http.push(['limit_req_log_level', 'warn']);
        config.http.push(['limit_req_zone', '$binary_remote_addr zone=login:10m rate=10r/m']);
    }

    // HTTPS
    let hasHttps = false;
    for (const domain of domains) {
        if (domain && domain.https && domain.https.https && domain.https.https.computed) {
            hasHttps = true;
            break;
        }
    }
    if (hasHttps) {
        config.http.push(['# SSL', '']);
        config.http.push(['ssl_session_timeout', '1d']);
        config.http.push(['ssl_session_cache', 'shared:SSL:10m']);
        config.http.push(['ssl_session_tickets', 'off']);

        const sslProfile = sslProfiles[global.https.sslProfile.computed];
        if (sslProfile) {
            if (sslProfile.dh_param_size) {

Review comment (suggestion):
```suggestion
    config.http.push(['access_log', (global.logging.accessLog.computed.trim() + (global.logging.cloudflare.computed ? ' cloudflare' : '')) || 'off']);
```
No need to template literal, just use the ternary directly -- add extra parens to avoid ambiguity

Code after:
    config.http.push(['types_hash_max_size', 2048]);
    config.http.push(['client_max_body_size', `${global.nginx.clientMaxBodySize.computed}M`]);

    config.http.push(['# MIME', '']);
    config.http.push(['include', 'mime.types']);
    config.http.push(['default_type', 'application/octet-stream']);

    // Append Cloudflare request headers to the default log format
    if (global.logging.cloudflare.computed) {
        config.http.push(['# Log Format', '']);

        // Define default log format as an array
        let logging = ['$remote_addr', '-', '$remote_user', '[$time_local]',
        '"$request"', '$status', '$body_bytes_sent',
        '"$http_referer"', '"$http_user_agent"'];

        if (global.logging.cfRay.computed)
            logging.push('$http_cf_ray');

        if (global.logging.cfConnectingIp.computed)
            logging.push('$http_cf_connecting_ip');

        if (global.logging.xForwardedFor.computed)
            logging.push('$http_x_forwarded_for');

        if (global.logging.xForwardedProto.computed)
            logging.push('$http_x_forwarded_proto');

        if (global.logging.trueClientIp.computed)
            logging.push('$http_true_client_ip');

        if (global.logging.cfIpCountry.computed)
            logging.push('$http_cf_ipcountry');

        if (global.logging.cfVisitor.computed)
            logging.push('$http_cf_visitor');

        if (global.logging.cdnLoop.computed)
            logging.push('$http_cdn_loop');

        config.http.push(['log_format', `cloudflare '${logging.join(' ')}'`]);
    }

    config.http.push(['# Logging', '']);
    config.http.push(['access_log', (global.logging.accessLog.computed.trim() + (global.logging.cloudflare.computed ? ' cloudflare' : '')) || 'off']);
    config.http.push(['error_log', global.logging.errorLog.computed.trim() || '/dev/null']);

    if (global.security.limitReq.computed) {
        config.http.push(['# Limits', '']);
        config.http.push(['limit_req_log_level', 'warn']);
        config.http.push(['limit_req_zone', '$binary_remote_addr zone=login:10m rate=10r/m']);