mirror of
https://github.com/PlayEdu/docker-playedu-light
synced 2025-06-06 14:54:11 +08:00
端口修改
This commit is contained in:
parent
d861eaf710
commit
13c58500c1
11
README.md
11
README.md
@ -17,7 +17,7 @@ docker build -t playedu-light .
|
||||
执行完毕之后,可运行下面命令将 PlayEdu 服务跑起来:
|
||||
|
||||
```
|
||||
docker run -d -p 9898:80 --name playedu-local \
|
||||
docker run -d -p 9800:9800 -p 9900:9900 --name playedu-local \
|
||||
-e DB_HOST=数据库host \
|
||||
-e DB_PORT=数据库端口 \
|
||||
-e DB_NAME=数据库名 \
|
||||
@ -36,8 +36,7 @@ docker run -d -p 9898:80 --name playedu-local \
|
||||
|
||||
跑起来之后,可以通过下面的链接访问前后台:
|
||||
|
||||
| 端口 | 地址 |
|
||||
| -------- | ----------------------------- |
|
||||
| 学员界面 | `http://localhost:9898` |
|
||||
| 后台管理 | `http://localhost:9898/admin` |
|
||||
| API 服务 | `http://localhost:9898/api` |
|
||||
| 端口 | 地址 |
|
||||
| -------- | ----------------------- |
|
||||
| 学员界面 | `http://localhost:9800` |
|
||||
| 后台管理 | `http://localhost:9900` |
|
||||
|
@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen 9800 default_server;
|
||||
absolute_redirect off;
|
||||
server_name _;
|
||||
|
||||
@ -24,11 +24,25 @@ server {
|
||||
proxy_pass http://127.0.0.1:9898/;
|
||||
}
|
||||
|
||||
location /admin {
|
||||
alias /app/backend;
|
||||
index index.html;
|
||||
|
||||
try_files $uri $uri/ /admin/index.html;
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~* ^/(?![api].*) {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 9900 default_server;
|
||||
absolute_redirect off;
|
||||
server_name _;
|
||||
|
||||
root /app/backend;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
@ -37,13 +51,19 @@ server {
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/javascript text/css application/xml text/javascript;
|
||||
gzip_vary on;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:9898/;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~* ^/(?![api|admin].*) {
|
||||
location ~* ^/(?![api].*) {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user