Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add nginx.conf #80

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
upstream api_service {
server 127.0.0.1:9380;
keepalive 2000;
}

server {
listen 5101;
# server_name xxx.com;

# gzip config
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]\.";


# remove api server header
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Access-Control-Allow-Methods;
proxy_hide_header Access-Control-Allow-Headers;

root /ragflow/web/dist;

location / {
index index.html;
try_files $uri $uri/ /index.html;
}

# Cache-Control: max-age、Expires
location ~ ^/static/(css|js|media)/ {
expires 10y;
access_log off;
}

# api proxy
location ^~/v1 {
rewrite ^/v1/(.*)$ /$1 break;
proxy_pass http://api_service/;
proxy_set_header Host $http_host;
proxy_set_header Connection close;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
}
}
2 changes: 1 addition & 1 deletion web/.umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
npmClient: 'npm',
base: '/',
routes,
publicPath: '/web/dist/',
publicPath: '/',
esbuildMinifyIIFE: true,
icons: {},
hash: true,
Expand Down