| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- server {
- listen 80;
- server_name localhost;
-
- # Increase client body size limit for file uploads
- client_max_body_size 500M;
- # Serve Static Files
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
- try_files $uri $uri/ /index.html;
- }
- # Proxy API requests to Backend
- location /api/ {
- proxy_pass http://backend:8000/api/;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # 大文件上传:读/写/连接超时 10 分钟
- proxy_connect_timeout 600s;
- proxy_send_timeout 600s;
- proxy_read_timeout 600s;
- # WebSocket Support
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
- # Proxy OIDC (Hydra public) with /hydra prefix
- location /hydra/ {
- # Strip /hydra prefix before forwarding to Hydra
- rewrite ^/hydra/(.*)$ /$1 break;
- proxy_pass http://hydra:4444;
- proxy_http_version 1.1;
- 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;
- }
- }
- server {
- listen 443 ssl;
- server_name localhost;
- ssl_certificate /etc/nginx/certs/server.crt;
- ssl_certificate_key /etc/nginx/certs/server.key;
- # SSL Settings
- ssl_session_timeout 1d;
- ssl_session_cache shared:SSL:50m;
- ssl_session_tickets off;
- ssl_protocols TLSv1.2 TLSv1.3;
- ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
- ssl_prefer_server_ciphers off;
-
- # Increase client body size limit for file uploads
- client_max_body_size 500M;
- # Serve Static Files
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
- try_files $uri $uri/ /index.html;
- }
- # Proxy API requests to Backend
- location /api/ {
- proxy_pass http://backend:8000/api/;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # 大文件上传:读/写/连接超时 10 分钟
- proxy_connect_timeout 600s;
- proxy_send_timeout 600s;
- proxy_read_timeout 600s;
- # WebSocket Support
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
- # Proxy OIDC (Hydra public) with /hydra prefix over HTTPS
- location /hydra/ {
- # Strip /hydra prefix before forwarding to Hydra
- rewrite ^/hydra/(.*)$ /$1 break;
- proxy_pass http://hydra:4444;
- proxy_http_version 1.1;
- 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;
- }
- }
|