apiVersion: v1
kind: ConfigMap
metadata:
  name: proxy-config
  namespace: anchor-monitor
data:
  default.conf: |-
    server {
      resolver 8.8.8.8 ipv6=off;
      listen 8080 default_server;
      server_name anchor.factomd.com;
      if ($http_x_forwarded_proto = "http") {
        return 301 https://$host$request_uri;
      }
      lua_ssl_trusted_certificate  /etc/ssl/certs/ca-bundle.crt;
      set $ngo_client_id         "48298444655-98uaj4hqbcvgpdsb51rqvqeq65584aaj.apps.googleusercontent.com";
      set $ngo_client_secret   "J6WFEskQID5ypeArCtubsSWK";
      set $ngo_domain          "factom.com";
      set $ngo_token_secret      "a ljashdkljalsjfaljhfvery long randomish string";
      #set $ngo_secure_cookies    "true";
      #set $ngo_http_only_cookies "true";

      location /health {
        return 200 'Healthy!';
      }
     
      access_by_lua_file "/etc/nginx/lua/nginx-google-oauth/access.lua";
      location / {
      
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          proxy_pass http://anchor-monitor-0.anchor-monitor:3000;
      }
    }
