apiVersion: v1
kind: ConfigMap
metadata:
  name: bazel-cache-nginx-config
  namespace: ${NAMESPACE}
data:
  default.conf: |
    server {
      listen       80;
      server_name  localhost;

      location /cache/ {
          # The path to the directory where nginx should store the cache contents.
          root /var/cache/bazel;
          # Allow PUT
          dav_methods PUT;
          # Allow nginx to create the /ac and /cas subdirectories.
          create_full_put_path on;
          # The maximum size of a single file.
          client_max_body_size 4G;
          allow all;
      }

      location / {
          root   /usr/share/nginx/html;
          index  index.html index.htm;
      }

      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   /usr/share/nginx/html;
      }
    }
