mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-10 21:32:43 +08:00
62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name your-ragflow-domain.com;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name your-ragflow-domain.com;
|
|
|
|
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
|
|
|
root /ragflow/web/dist;
|
|
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_comp_level 9;
|
|
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
|
gzip_vary on;
|
|
gzip_disable "MSIE [1-6]\.";
|
|
|
|
location ~ ^/api/v1/admin {
|
|
proxy_pass http://localhost:9381;
|
|
include proxy.conf;
|
|
}
|
|
|
|
location ~ ^/(v1|api) {
|
|
proxy_pass http://localhost:9380;
|
|
include proxy.conf;
|
|
}
|
|
|
|
|
|
location / {
|
|
index index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
# The entry document must never come from cache: a stale index.html
|
|
# references hashed bundles that no longer exist after an image
|
|
# upgrade.
|
|
add_header Cache-Control "no-store";
|
|
}
|
|
|
|
# Direct navigation to the chunk routes must reach the SPA fallback:
|
|
# without this block those paths match the hashed-asset location below,
|
|
# and a missing file answers 404 instead of the app shell. Regex
|
|
# locations are matched in order, so this must come first.
|
|
location ~ ^/chunk/(parsed/chunks|chunk/[^/]+|result/[^/]+)$ {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Hashed bundles are immutable, so they may cache for a year, and a stale
|
|
# reference after an upgrade must answer 404 instead of the SPA fallback
|
|
# HTML, which a dynamic import() cannot parse.
|
|
location ~ ^/(chunk|entry|assets)/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
access_log off;
|
|
try_files $uri =404;
|
|
}
|
|
}
|