Quantcast
Viewing all articles
Browse latest Browse all 1542

NGINX Reverse Proxy - ERR_TOO_MANY_REDIRECTS - how to fix?

Until now, I used a PHP script on the main server B 93.151.75.75, which was behind the NGINX reverse proxy server A 173.176.183.183. On the website2.com domain name. And it worked.Now I have installed a new PHP script on the website2.com domain name and am crashing (((If I set the HTTP protocol in the script settings, I get mixed content errors. If I turn on the HTTPS protocol, then I get an error - ERR_TOO_MANY_REDIRECTS.I tried placing this script on the website3.com domain name and it worked fine. Of course my main server B 93.151.75.75 has SSL certificates from Cloudflare on the website3.com domain name.How can I make this PHP script work correctly on the website2.com domain?What am I doing wrong in server A 173.176.183.183 reverse proxy settings?

I am attaching below NGINX reverse proxy A 173.176.183.183 config and information from Redirect Checker.I would be very grateful for advice!

View server configuration

nginx.conf (NGINX reverse proxy173.176.183.183)

user nginx;worker_processes auto;error_log /var/log/nginx/error.log;pid /run/nginx.pid;# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.include /usr/share/nginx/modules/*.conf;events {worker_connections 1024;}http {log_format main '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';access_log /var/log/nginx/access.log main;sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 65;types_hash_max_size 2048;client_header_timeout 5s;client_body_timeout 5s;send_timeout 10s;reset_timedout_connection on;client_header_buffer_size 2k;client_body_buffer_size 20k;large_client_header_buffers 4 8k;include /etc/nginx/mime.types;default_type application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.# include /etc/nginx/conf.d/*.conf;#proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_cache:8m inactive=10m max_size=1024M;#proxy_cache_min_uses 1;server {listen 80;server_name website2.com www.website2.com;access_log /var/log/nginx/website2.com-access.log;error_log /var/log/nginx/website2.com-error.log;return 301 https://$server_name$request_uri;}server {listen 443 ssl;ssl_certificate /etc/ssl/www.website2.com.pem;ssl_certificate_key /etc/ssl/www.website2.com.key;server_name website2.com;access_log /var/log/nginx/website2.com-ssl-access.log;error_log /var/log/nginx/website2.com-ssl-error.log;client_max_body_size 100m;location / {proxy_pass http://93.151.75.75;proxy_set_header Host $host;proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;proxy_set_header X-Real-IP $remote_addr;#proxy_request_buffering off;#proxy_cache static_cache;}}}

Redirect Checker:

https://website2.com/302 Foundhttps://website2.com302 Foundhttps://website2.com302 Foundhttps://website2.com302 Foundhttps://website2.com302 Foundhttps://website2.com302 Foundhttps://website2.com302 Foundhttps://website2.com.........>>> https://website2.com/> --------------------------------------------> 302 Found> --------------------------------------------Status: 302 FoundCode: 302Server: nginx/1.16.1Date: Fri, 30 Apr 2021 14:05:18 GMTContent-Type: text/html; charset=UTF-8Connection: closeX-Powered-By: PHP/7.3.24Location: https://website2.comSet-Cookie: PHPSESSID=016eaf866d782aad092458f7ecf65f9c; path=/; HttpOnlyExpires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheVary: Accept-Encoding>>> https://website2.com> --------------------------------------------> 302 Found> --------------------------------------------Status: 302 FoundCode: 302Server: nginx/1.16.1Date: Fri, 30 Apr 2021 14:05:18 GMTContent-Type: text/html; charset=UTF-8Connection: closeX-Powered-By: PHP/7.3.24Location: https://website2.comSet-Cookie: PHPSESSID=f5bb7fb2f39189d662f3357ff61927f3; path=/; HttpOnlyExpires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheVary: Accept-Encoding>>> https://website2.com> --------------------------------------------> 302 Found> --------------------------------------------Status: 302 FoundCode: 302Server: nginx/1.16.1Date: Fri, 30 Apr 2021 14:05:18 GMTContent-Type: text/html; charset=UTF-8Connection: closeX-Powered-By: PHP/7.3.24Location: https://website2.comSet-Cookie: PHPSESSID=c0cb7b8a0e23d2726f3c0f8070192b04; path=/; HttpOnlyExpires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheVary: Accept-Encoding....................

Viewing all articles
Browse latest Browse all 1542

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>