---

apiVersion: v1
kind: ConfigMap
metadata:
  name: simply-nginx-conf
data:
  nginx.conf: |-
    user  nginx;
    worker_processes  auto;
    worker_rlimit_nofile 30720;

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

    events {
        worker_connections  10240;
        multi_accept on;
    }

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

        log_format ltsv 'time:$time_local\t'
                        'server:$server_name\t'
                        'remote_addr:$remote_addr\t'
                        'x_forwarded_for:$http_x_forwarded_for\t'
                        'time_local:$msec\t'
                        'request_uri:$request_uri\t'
                        'request:$request\t'
                        'body_bytes_sent:$body_bytes_sent\t'
                        'status:$status\t'
                        'referer:$http_referer\t'
                        'user_agent:$http_user_agent';

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

        access_log  /var/log/nginx/access.log main buffer=16k flush=2m;

        types_hash_max_size 2048;

        client_max_body_size 500M;

        sendfile        on;
        tcp_nopush      on;
        tcp_nodelay     on;

        keepalive_timeout  65;
        keepalive_requests 100;

        server_names_hash_bucket_size 64;
        server_tokens off;

        # gzip on;

        gzip                      on;
        gzip_static               on;

        proxy_read_timeout        300;
        proxy_send_timeout        300;
        proxy_connect_timeout     300;

        proxy_intercept_errors    on;

        proxy_set_header          Connection 'keep-alive';
        proxy_set_header          Host $http_host;
        proxy_set_header          X-Scheme $scheme;
        proxy_set_header          X-Real-IP $remote_addr;
        proxy_set_header          X-Forwarded-For $proxy_add_x_forwarded_for;

        # upstream base_backend {
        #     server eiicon:8000;
        # }

        # server {
        #     listen 80;

        #     location / {
        #         proxy_pass         http://eiicon_backend;
        #         proxy_redirect     off;
        #     }
        # }

        # include /etc/nginx/conf.d/*.conf;  # Disable to conf.d/default.conf
        include /etc/nginx/sites-enabled/*;
    }

