summaryrefslogtreecommitdiff
path: root/internal/suites/example/compose/nginx/backend/html/public/index.html
blob: bdd688b10cb94a731d1d573306c3b2b92587450a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE>
<html>
  <head>
    <title>Public resource</title>
    <link rel="icon" href="/icon.png" type="image/png" />
    <script>
      window.onload = () =>{
        /**
         * this section renames example.com for the real hostname
         * it's required for multi cookie domain suite
         * */
        const hostname = window.location.hostname
        const protocol = window.location.protocol
        const port = window.location.port
        const domain = hostname.replace(/^\w+\.(.+)$/i, "$1")
        const newDomain = `${domain}:${port}`
        document.body.innerHTML = document.body.innerHTML.replace(/example.com:8080/ig, newDomain)
      }

    </script>
    </head>
  <body>
    <h1>Public resource</h1>
    <p>This is a public resource.<br/>
    Go back to <a href="https://home.example.com:8080/">home page</a>.
    </p>
  </body>
</html>