我创建了一个 GCP 云实例来托管 RockerChat。我正在使用 Nginx 和 Cloudflare 通过我的域访问它。但它显示了太多重定向错误。
ERR_TOO_MANY_REDIRECTS
我是这方面的新手,非常感谢任何帮助!
使用 ip_address:port 访问是可以的,但使用域会导致太多重定向错误。以下是我的 Nginx 配置:
活动{
worker_connections 1024;
}
http {
client_max_body_size 1000m;
服务器{
listen 80;
server_name chat.miahomebuyerservice.com.;
return 301 https://$host$request_uri;
}
服务器{
听443 ssl;
服务器名称 chat.miahomebuyerservice.com;
http2 开启;
ssl_certificate /etc/nginx/certs/chat-cert.pem;
ssl_certificate_key /etc/nginx/certs/chat-key.pem;
add_header 严格传输安全“max-age=31536000; includeSubDomains; 预加载”;
地点/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://34.125.124.2:8890/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
非常感谢任何帮助!
此问题可能由多种原因引起;我怀疑是否能找到解决方案,但这是清单:
希望以上几点能够解决您的问题。