apiVersion: v1
kind: ConfigMap
metadata:
  name: reverse-proxy
data:
  nginx.conf: |-
    map $http_cookie $auth_bearer {
      default "";
      "~^skymarshal_auth=\"Bearer (?<token>.+)\"$" "$token";
    }

    server {
      listen 8080 default_server;

      location / {
        proxy_pass http://concourse-web:8080;
        proxy_request_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_http_version 1.1;
        proxy_read_timeout 90;

        set $auth_bearer_user_name '';
        set $auth_bearer_email '';

        log_by_lua_block {
          local jwt = require "resty.jwt"
          local cjson = require "cjson"
          local jwt_obj = jwt:load_jwt(ngx.var.auth_bearer)
          if jwt_obj.payload then
            ngx.var.auth_bearer_user_name = jwt_obj.payload.user_name
            ngx.var.auth_bearer_email = jwt_obj.payload.email
          end
        }
      }
    }

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

    access_log logs/access.log main;

apiVersion: v1
kind: ConfigMap
metadata:
  name: reverse-proxy
data:
  nginx.conf: |-
    map $http_cookie $auth_bearer {
      default "";
      "~^skymarshal_auth=\"Bearer (?<token>.+)\"$" "$token";
    }

    server {
      listen 8080 default_server;

      location / {
        proxy_pass http://concourse-web:8080;
        proxy_request_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_http_version 1.1;
        proxy_read_timeout 1800;

        set $auth_bearer_user_name '';
        set $auth_bearer_email '';

        log_by_lua_block {
          local jwt = require "resty.jwt"
          local cjson = require "cjson"
          local jwt_obj = jwt:load_jwt(ngx.var.auth_bearer)
          if jwt_obj.payload then
            ngx.var.auth_bearer_user_name = jwt_obj.payload.user_name
            ngx.var.auth_bearer_email = jwt_obj.payload.email
          end
        }
      }
    }

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

    access_log logs/access.log main;

Raise concourse reverse proxy read timeout
Raise concourse reverse proxy read timeout
