控制台反向代理配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | server { listen 80; server_name xxx.odooing.online; root /var/www/html; #确保将 your_domain.com 替换为你的实际域名,并将 root 设置为你网站文件所在的路径。 index index.html index.htm index.nginx-debian.html; location / { 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; # 向 MinIO 服务器发送请求 proxy_pass http://127.0.0.1:19001; # MinIO 默认运行在 19001 端口 proxy_buffering off; } location /ws/objectManager { proxy_pass http://127.0.0.1:19001; # 这里填写你 WebSocket 后端服务的 IP 和端口 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; # 避免超时,WebSocket 通常会保持长连接 proxy_read_timeout 86400; } } |
文件访问反向代理配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | server { listen 80; server_name xxx.odooing.online; root /var/www/html; #确保将 your_domain.com 替换为你的实际域名,并将 root 设置为你网站文件所在的路径。 index index.html index.htm index.nginx-debian.html; location / { 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; # 向 MinIO 服务器发送请求 proxy_pass http://127.0.0.1:19000; # MinIO 默认运行在 19000 端口 proxy_buffering off; } } |