apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx
  labels:
    app: nginx
data:
  nginx.conf: |
    daemon off;
    pid /var/run/nginx.pid;
    error_log  /var/log/nginx/error.log;
    worker_processes auto;

    http {

      server {
          listen 80;
          listen [::]:80 ipv6only=on;

          root /var/www/localhost/htdocs;
          index index.html index.htm;

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

      server {
          listen 443 ssl http2;
          listen [::]:443 ssl http2;

          ssl on;
          root /var/www/localhost/htdocs;
          index index.html index.htm;

          ssl_certificate     /etc/ssl/cert/nginx.crt;
          ssl_certificate_key /etc/ssl/private/nginx.key;

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

          #location ~ \.php$ {
          #      fastcgi_pass      127.0.0.1:9000;
          #      fastcgi_index     index.php;
          #      include           fastcgi.conf;
          #}
    }

    events {

    }
