update
Browse files- README copy.md +10 -0
- README.md +20 -1
- docker-compose.yml +13 -0
- nginx/conf.d/default.conf +14 -0
- nginx/html/index.html +17 -0
- nginx/nginx.conf +13 -0
README copy.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Ocngx
|
| 3 |
+
emoji: 💻
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
README.md
CHANGED
|
@@ -7,4 +7,23 @@ sdk: docker
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# Nginx 服务
|
| 11 |
+
|
| 12 |
+
使用 Docker Compose 运行 nginx 服务器:
|
| 13 |
+
|
| 14 |
+
```bash
|
| 15 |
+
docker-compose up -d
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
访问 http://localhost:8080 查看服务。
|
| 19 |
+
|
| 20 |
+
停止服务:
|
| 21 |
+
```bash
|
| 22 |
+
docker-compose down
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
## 配置文件说明
|
| 26 |
+
|
| 27 |
+
- `nginx/nginx.conf` - 主配置文件
|
| 28 |
+
- `nginx/conf.d/default.conf` - 虚拟主机配置
|
| 29 |
+
- `nginx/html/index.html` - 默认首页
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: '3.8'
|
| 2 |
+
|
| 3 |
+
services:
|
| 4 |
+
nginx:
|
| 5 |
+
image: nginx:latest
|
| 6 |
+
container_name: nginx-server
|
| 7 |
+
ports:
|
| 8 |
+
- "8080:80"
|
| 9 |
+
volumes:
|
| 10 |
+
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
| 11 |
+
- ./nginx/conf.d:/etc/nginx/conf.d
|
| 12 |
+
- ./nginx/html:/usr/share/nginx/html
|
| 13 |
+
restart: unless-stopped
|
nginx/conf.d/default.conf
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 80;
|
| 3 |
+
server_name localhost;
|
| 4 |
+
|
| 5 |
+
location / {
|
| 6 |
+
root /usr/share/nginx/html;
|
| 7 |
+
index index.html index.htm;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
error_page 500 502 503 504 /50x.html;
|
| 11 |
+
location = /50x.html {
|
| 12 |
+
root /usr/share/nginx/html;
|
| 13 |
+
}
|
| 14 |
+
}
|
nginx/html/index.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>Welcome to nginx!</title>
|
| 5 |
+
<style>
|
| 6 |
+
body {
|
| 7 |
+
width: 35em;
|
| 8 |
+
margin: 0 auto;
|
| 9 |
+
font-family: Tahoma, Verdana, Arial, sans-serif;
|
| 10 |
+
}
|
| 11 |
+
</style>
|
| 12 |
+
</head>
|
| 13 |
+
<body>
|
| 14 |
+
<h1>Welcome to nginx!</h1>
|
| 15 |
+
<p>If you see this page, the nginx web server is successfully installed and working.</p>
|
| 16 |
+
</body>
|
| 17 |
+
</html>
|
nginx/nginx.conf
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
events {
|
| 2 |
+
worker_connections 1024;
|
| 3 |
+
}
|
| 4 |
+
|
| 5 |
+
http {
|
| 6 |
+
include /etc/nginx/mime.types;
|
| 7 |
+
default_type application/octet-stream;
|
| 8 |
+
|
| 9 |
+
sendfile on;
|
| 10 |
+
keepalive_timeout 65;
|
| 11 |
+
|
| 12 |
+
include /etc/nginx/conf.d/*.conf;
|
| 13 |
+
}
|