Skip to content

Commit

Permalink
updated web page
Browse files Browse the repository at this point in the history
  • Loading branch information
s-archer committed Sep 9, 2024
1 parent 4c6d893 commit 0c0a779
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
48 changes: 47 additions & 1 deletion http.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,54 @@ function baz(r) {
r.finish();
}

// function hello(r) {
// r.return(200, "Hello world!");
// }
function hello(r) {
r.return(200, "Hello world!");
r.return(200, `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello World</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
text-align: center;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1 {
color: #333;
font-size: 3rem;
margin: 0;
}
p {
color: #666;
font-size: 1.2rem;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>Hello World!</h1>
<p>Welcome to your awesome HTML page.</p>
</div>
</body>
</html>
`);
}

// since 0.7.0
Expand Down
8 changes: 8 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ http {
return 200 $summary;
}

location = /foo {
return 200 $foo;
}

location = /hash {
return 200 $hash;
}

location = /hello {
js_content http.hello;
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/origin.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "volterra_origin_pool" "nginx-reflector" {
description = "nginx-reflector"
endpoint_selection = "LOCAL_PREFERRED"
loadbalancer_algorithm = "LB_OVERRIDE"
port = 80
port = 8080
no_tls = true

origin_servers {
Expand Down

0 comments on commit 0c0a779

Please sign in to comment.