http:
  services:
    novnc:
      loadBalancer:
        servers:
          - url: "http://localhost:6080"
  
  routers:
    novnc:
      rule: "Host(`novnc.gabsdev.com`)"
      entryPoints:
        - websecure
      service: novnc
      middlewares:
        - novnc-redirect
      tls:
        certResolver: letsencrypt
    
    novnc-websocket:
      rule: "Host(`novnc.gabsdev.com`) && Path(`/websockify`)"
      entryPoints:
        - websecure
      service: novnc
      tls:
        certResolver: letsencrypt
        
    novnc-direct:
      rule: "Host(`novnc.gabsdev.com`) && Path(`/`)"
      entryPoints:
        - websecure
      service: novnc
      middlewares:
        - novnc-redirect
      priority: 100
      tls:
        certResolver: letsencrypt
  
  middlewares:
    novnc-redirect:
      redirectRegex:
        regex: "^https://novnc.gabsdev.com/?$"
        replacement: "https://novnc.gabsdev.com/vnc.html?host=novnc.gabsdev.com&port=443&encrypt=1&password=vnc123456&autoconnect=1&path=websockify"