I have created a GCP cloud instance to host RockerChat. I am using Nginx and Cloudflare to access it with my domain. But it shows a too many redirects error.
ERR_TOO_MANY_REDIRECTS
I am a newbie to this, any help is much appreciated!
Access with ip_address:port is ok but with domain leads to a too many redirects error. Below is my Nginx config:
events {
worker_connections 1024;
}
http {
client_max_body_size 1000m;
server {
listen 80;
server_name chat.miahomebuyerservice.com.;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name chat.miahomebuyerservice.com;
http2 on;
ssl_certificate /etc/nginx/certs/chat-cert.pem;
ssl_certificate_key /etc/nginx/certs/chat-key.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
location / {
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";
}
Any help is much appreciated!
This issue could be causing by multiple reason; I doubt to pinpoint solution but here’s checklist:
I hope above points may able to solve your issue.