mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 00:00:49 +00:00
Improved the Nginx example
This commit is contained in:
parent
3c730d4610
commit
78c9c73c77
@ -19,7 +19,7 @@ format defined by the WebAssembly reference interpreter (`.wat`).
|
||||
Once installed, you will be able to run:
|
||||
|
||||
```sh
|
||||
wasmer run nginx.wasm
|
||||
wasmer run examples/nginx/nginx.wasm -- -p examples/nginx -c nginx.conf
|
||||
```
|
||||
|
||||
## Building & Running
|
||||
|
1
examples/nginx/.gitignore
vendored
Normal file
1
examples/nginx/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*_temp
|
36
examples/nginx/html/index.html
Normal file
36
examples/nginx/html/index.html
Normal file
@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Open+Sans"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<h1>
|
||||
You did it! Nginx is running using
|
||||
<a href="https://wasmer.io"
|
||||
><img class="wasmer-logo" src="./wasmer-logo.png"
|
||||
/></a>
|
||||
</h1>
|
||||
<p>Enjoy this incredible achievement with us! 😊</p>
|
||||
</div>
|
||||
</body>
|
||||
<style>
|
||||
body {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: 600;
|
||||
}
|
||||
.main {
|
||||
margin: 0 auto;
|
||||
max-width: 600px;
|
||||
padding: 10px;
|
||||
}
|
||||
.wasmer-logo {
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
</html>
|
BIN
examples/nginx/html/wasmer-logo.png
Normal file
BIN
examples/nginx/html/wasmer-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
0
examples/nginx/logs/nginx.pid
Normal file
0
examples/nginx/logs/nginx.pid
Normal file
24
examples/nginx/nginx.conf
Normal file
24
examples/nginx/nginx.conf
Normal file
@ -0,0 +1,24 @@
|
||||
events {
|
||||
}
|
||||
|
||||
# We need this for now, as we want to run nginx as a worker
|
||||
daemon off;
|
||||
master_process off;
|
||||
|
||||
# We show the errors and info in stderr
|
||||
error_log /dev/stderr info;
|
||||
|
||||
http {
|
||||
# We show access in the stdout
|
||||
access_log /dev/stdout;
|
||||
server {
|
||||
listen 8080;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
# IMPORTANT: Replace the dir with the one you want to serve (that have an index.html file)
|
||||
root ./html/;
|
||||
index index.html;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user