mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-11-02 03:01:52 +08:00
Merge the standalone iot-dc3-web repository into iot-dc3 as dc3-web/, creating a single monorepo with unified versioning, CI/CD, and release process. - subtree-add iot-dc3-web under dc3-web/ with full commit history - relocate nginx configs and SSL certs to dc3/dependencies/ - merge CI workflows (ci-backend.yml, ci-web.yml, docker-ci-web.yml) - merge Issue/PR templates and dependabot config - host frontend docs under docs/zh/frontend/ - share .husky/ hooks via root-level package.json (pnpm) - unify versioning: single dc3/bin/tag.sh (vYYYY.M.P) for the whole repo - update Dockerfile, docker-compose.yml, Makefile for new paths - remove redundant directories from dc3-web/ (.claude, .github, dc3, docs, bin) Co-Authored-By: Claude <noreply@anthropic.com>
78 lines
2.5 KiB
Bash
78 lines
2.5 KiB
Bash
#
|
|
# Copyright 2016-present the IoT DC3 original author or authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
# Static files location
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
|
|
# Cache control for static assets
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Cache control for HTML files
|
|
location ~* \.(html|htm)$ {
|
|
expires -1;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
}
|
|
|
|
# Nginx stub status for monitoring
|
|
location /stub_status {
|
|
stub_status on;
|
|
access_log off;
|
|
allow 127.0.0.1;
|
|
deny all;
|
|
}
|
|
|
|
# API proxy with rate limiting
|
|
location ^~/api/ {
|
|
# Apply rate limiting
|
|
limit_req zone=api burst=20 nodelay;
|
|
|
|
# Proxy settings
|
|
proxy_pass http://${APP_API_HOST}:${APP_API_PORT}/api/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
# Timeouts
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
|
|
# Streaming responses, such as the Agentic SSE endpoint, must flush as data arrives.
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_cache off;
|
|
proxy_buffer_size 4k;
|
|
proxy_buffers 8 4k;
|
|
proxy_busy_buffers_size 8k;
|
|
}
|
|
|
|
# Error pages
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
internal;
|
|
}
|