KevinHuSh
commited on
Commit
·
4873964
1
Parent(s):
98d3c3f
resolve user login issue, and docker confiuration issue (#84)
Browse files- docker/docker-compose.yml +3 -1
- docker/entrypoint.sh +3 -1
- docker/nginx/nginx.conf +33 -0
- docker/nginx/proxy.conf +8 -0
- docker/{nginx.conf → nginx/ragflow.conf} +7 -25
docker/docker-compose.yml
CHANGED
@@ -105,7 +105,9 @@ services:
|
|
105 |
volumes:
|
106 |
- ./service_conf.yaml:/ragflow/conf/service_conf.yaml
|
107 |
- ./ragflow-logs:/ragflow/logs
|
108 |
-
- ./nginx.conf:/etc/nginx/conf.d/ragflow.conf
|
|
|
|
|
109 |
networks:
|
110 |
- ragflow
|
111 |
restart: always
|
|
|
105 |
volumes:
|
106 |
- ./service_conf.yaml:/ragflow/conf/service_conf.yaml
|
107 |
- ./ragflow-logs:/ragflow/logs
|
108 |
+
- ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf
|
109 |
+
- ./nginx/proxy.conf:/etc/nginx/proxy.conf
|
110 |
+
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
111 |
networks:
|
112 |
- ragflow
|
113 |
restart: always
|
docker/entrypoint.sh
CHANGED
@@ -31,4 +31,6 @@ function task_bro(){
|
|
31 |
task_bro &
|
32 |
task_exe &
|
33 |
|
34 |
-
$PY api/ragflow_server.py
|
|
|
|
|
|
31 |
task_bro &
|
32 |
task_exe &
|
33 |
|
34 |
+
$PY api/ragflow_server.py
|
35 |
+
|
36 |
+
wait;
|
docker/nginx/nginx.conf
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
user root;
|
2 |
+
worker_processes auto;
|
3 |
+
|
4 |
+
error_log /var/log/nginx/error.log notice;
|
5 |
+
pid /var/run/nginx.pid;
|
6 |
+
|
7 |
+
|
8 |
+
events {
|
9 |
+
worker_connections 1024;
|
10 |
+
}
|
11 |
+
|
12 |
+
|
13 |
+
http {
|
14 |
+
include /etc/nginx/mime.types;
|
15 |
+
default_type application/octet-stream;
|
16 |
+
|
17 |
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
18 |
+
'$status $body_bytes_sent "$http_referer" '
|
19 |
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
20 |
+
|
21 |
+
access_log /var/log/nginx/access.log main;
|
22 |
+
|
23 |
+
sendfile on;
|
24 |
+
#tcp_nopush on;
|
25 |
+
|
26 |
+
keepalive_timeout 65;
|
27 |
+
|
28 |
+
#gzip on;
|
29 |
+
client_max_body_size 82M;
|
30 |
+
|
31 |
+
include /etc/nginx/conf.d/ragflow.conf;
|
32 |
+
}
|
33 |
+
|
docker/nginx/proxy.conf
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
proxy_set_header Host $host;
|
2 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
3 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
4 |
+
proxy_http_version 1.1;
|
5 |
+
proxy_set_header Connection "";
|
6 |
+
proxy_buffering off;
|
7 |
+
proxy_read_timeout 3600s;
|
8 |
+
proxy_send_timeout 3600s;
|
docker/{nginx.conf → nginx/ragflow.conf}
RENAMED
@@ -1,13 +1,8 @@
|
|
1 |
-
upstream api_service {
|
2 |
-
server ragflow:9380;
|
3 |
-
keepalive 2000;
|
4 |
-
}
|
5 |
-
|
6 |
server {
|
7 |
listen 80;
|
8 |
-
server_name
|
|
|
9 |
|
10 |
-
# gzip config
|
11 |
gzip on;
|
12 |
gzip_min_length 1k;
|
13 |
gzip_comp_level 9;
|
@@ -15,32 +10,19 @@ server {
|
|
15 |
gzip_vary on;
|
16 |
gzip_disable "MSIE [1-6]\.";
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
proxy_hide_header Access-Control-Allow-Headers;
|
23 |
-
|
24 |
-
root /ragflow/web/dist;
|
25 |
|
26 |
location / {
|
27 |
index index.html;
|
28 |
try_files $uri $uri/ /index.html;
|
29 |
}
|
30 |
|
31 |
-
# Cache-Control: max-age
|
32 |
location ~ ^/static/(css|js|media)/ {
|
33 |
expires 10y;
|
34 |
access_log off;
|
35 |
}
|
36 |
-
|
37 |
-
# api proxy
|
38 |
-
location ^~/v1 {
|
39 |
-
rewrite ^/v1/(.*)$ /$1 break;
|
40 |
-
proxy_pass http://api_service/;
|
41 |
-
proxy_set_header Host $http_host;
|
42 |
-
proxy_set_header Connection close;
|
43 |
-
proxy_set_header X-Real-IP $remote_addr;
|
44 |
-
proxy_set_header X-Forwarded-Server $host;
|
45 |
-
}
|
46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
server {
|
2 |
listen 80;
|
3 |
+
server_name _;
|
4 |
+
root /ragflow/web/dist;
|
5 |
|
|
|
6 |
gzip on;
|
7 |
gzip_min_length 1k;
|
8 |
gzip_comp_level 9;
|
|
|
10 |
gzip_vary on;
|
11 |
gzip_disable "MSIE [1-6]\.";
|
12 |
|
13 |
+
location /v1 {
|
14 |
+
proxy_pass http://ragflow:9380;
|
15 |
+
include proxy.conf;
|
16 |
+
}
|
|
|
|
|
|
|
17 |
|
18 |
location / {
|
19 |
index index.html;
|
20 |
try_files $uri $uri/ /index.html;
|
21 |
}
|
22 |
|
23 |
+
# Cache-Control: max-age~@~AExpires
|
24 |
location ~ ^/static/(css|js|media)/ {
|
25 |
expires 10y;
|
26 |
access_log off;
|
27 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|