apiVersion: v1
kind: ConfigMap
metadata:
  name: diary-nginx
  namespace: blog
data:
  default.conf: |
    server {
        listen       80;
        server_name  localhost;
        resolver 10.43.0.10;
        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }
 
        location ~ (?<filename>.+\.(jpg|jpeg|png))$ {
          rewrite /(.*)/(.*)\.(jpg|png|jpeg)$ /$2.$3 break;
          proxy_pass  http://image-web.blog.svc.cluster.local;
        }
    }

