apiVersion: v1
kind: ConfigMap
metadata:
  name: ambassador-nginx-conf
  namespace: braini
data:
  default.conf: |
        server {
                listen                  80;
                listen                  [::]:80;
                server_name             helx.helx-dev.renci.org;

                location /private/ {
                         resolver coredns.kube-system;
                         proxy_http_version 1.1;
                         proxy_read_timeout 3600;
                         auth_request /auth;
                         auth_request_set $remoteUser $upstream_http_remote_user;
                         proxy_set_header REMOTE_USER $remoteUser;
                         add_header REMOTE_USER $remoteUser;
                         proxy_pass http://ambassador:80$request_uri;
                         proxy_pass_request_headers      on;
                }

                location = /auth {
                         proxy_http_version 1.1;
                         proxy_pass http://ambassador:80/auth/;
                         proxy_read_timeout 3600;
                         proxy_pass_request_body off;
                         proxy_set_header        Content-Length "";
                         proxy_set_header        X-Original-URI $request_uri;
                         resolver coredns.kube-system;
                }

                location / {
                         proxy_connect_timeout   60s;
                         proxy_send_timeout      60s;
                         proxy_read_timeout 60s;
                         proxy_http_version 1.1;
                         proxy_pass http://ambassador:80;
                         proxy_set_header requestUri $request_uri;
                         resolver coredns.kube-system;
                }


        }
