| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- server {
- listen 80;
- server_name _;
- # Admin UI
- location /admin/ {
- alias /usr/share/nginx/admin/;
- try_files $uri $uri/ /admin/index.html;
- add_header Cache-Control "no-cache, no-store, must-revalidate";
- add_header Pragma "no-cache";
- add_header Expires "0";
- }
- # Builder UI
- location /builder/ {
- alias /usr/share/nginx/builder/;
- try_files $uri $uri/ /builder/index.html;
- }
- # Chat UI
- location /chat/ {
- alias /usr/share/nginx/chat/;
- try_files $uri $uri/ /chat/index.html;
- }
- # Backend API
- location /admin/api/ {
- proxy_pass http://web:8080;
- 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;
- }
- location /builder/api/ {
- proxy_pass http://web:8080;
- 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;
- }
- location /chat/api/ {
- proxy_pass http://web:8080;
- 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;
- }
- # Static files
- location /doc/ {
- proxy_pass http://web:8080;
- }
- location /schema/ {
- proxy_pass http://web:8080;
- }
- location /static/ {
- proxy_pass http://web:8080;
- }
- # OpenAI 兼容网关
- location /api/v1/ {
- proxy_pass http://web:8080;
- 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;
- proxy_buffering off;
- proxy_cache off;
- chunked_transfer_encoding off;
- }
- # OSS files
- location ~ ^/(admin|builder|chat)/oss/ {
- proxy_pass http://web:8080;
- }
- # Default redirect to admin
- location / {
- return 302 /admin/;
- }
- }
|