Add instructions for nginx

master
Jiajie Chen 6 years ago
parent a2c714f460
commit 69febc9fcc

@ -62,6 +62,8 @@ After building redis, you should be able to run redis-server in rCore. Then, sta
Then you should be able to connect to it using `redis-cli` over the network:
```bash
$ redis-cli -h 10.0.0.2 get abc
(nil)
$ redis-cli -h 10.0.0.2 set abc def
OK
$ redis-cli -h 10.0.0.2 get abc
@ -69,3 +71,53 @@ $ redis-cli -h 10.0.0.2 get abc
```
Note: `redis-cli` in rCore is not working at the time.
## How to use nginx
Nginx is statically linked to musl instead, so there is no need to copy its dynamic loader. A nginx.conf is provided in this repo and automatically copied to its destination. So, just start `nginx` directly:
```bash
/> nginx
```
Then you should be able to visit it via network:
```bash
$ curl http://10.0.0.2/
<html>
<head><title>Index of /</title></head>
<body bgcolor="white">
<h1>Index of /</h1><hr><pre><a href="../">../</a>
<a href="bin/">bin/</a> 01-Jan-1970 00:00 -
<a href="biscuit/">biscuit/</a> 01-Jan-1970 00:00 -
<a href="dev/">dev/</a> 01-Jan-1970 00:00 -
<a href="etc/">etc/</a> 01-Jan-1970 00:00 -
<a href="home/">home/</a> 01-Jan-1970 00:00 -
<a href="lib/">lib/</a> 01-Jan-1970 00:00 -
<a href="media/">media/</a> 01-Jan-1970 00:00 -
<a href="mnt/">mnt/</a> 01-Jan-1970 00:00 -
<a href="opt/">opt/</a> 01-Jan-1970 00:00 -
<a href="proc/">proc/</a> 01-Jan-1970 00:00 -
<a href="root/">root/</a> 01-Jan-1970 00:00 -
<a href="run/">run/</a> 01-Jan-1970 00:00 -
<a href="rust/">rust/</a> 01-Jan-1970 00:00 -
<a href="sbin/">sbin/</a> 01-Jan-1970 00:00 -
<a href="srv/">srv/</a> 01-Jan-1970 00:00 -
<a href="sys/">sys/</a> 01-Jan-1970 00:00 -
<a href="tmp/">tmp/</a> 01-Jan-1970 00:00 -
<a href="usr/">usr/</a> 01-Jan-1970 00:00 -
<a href="var/">var/</a> 01-Jan-1970 00:00 -
<a href="busybox">busybox</a> 01-Jan-1970 00:00 1141024
<a href="nginx">nginx</a> 01-Jan-1970 00:00 741288
<a href="nginx-remote">nginx-remote</a> 01-Jan-1970 00:00 762440
<a href="nginx.conf">nginx.conf</a> 01-Jan-1970 00:00 99
<a href="redis-cli">redis-cli</a> 01-Jan-1970 00:00 221256
<a href="redis-server">redis-server</a> 01-Jan-1970 00:00 1120888
<a href="redis.conf">redis.conf</a> 01-Jan-1970 00:00 18
</pre><hr></body>
</html>
```
It is generated by `autoindex`.
Note: `nginx` might lead to an unresolved file system bug, so you might need to re-create sfs img after killing it.
Loading…
Cancel
Save