Report this

What is the reason for this report?

error too many redirect on nginx ?

Posted on July 3, 2015

My site have just install SSL but SSL not work. If I type latena.vn, the site accessible normally but I type https://latena.vn my site unaccessible and receive a error too many redirect I run command nginx -t and receive a warning nginx: [warn] conflicting server name “latena.vn” on 0.0.0.0:80, ignored nginx: [warn] conflicting server name “latena.vn” on 0.0.0.0:443, ignored nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful I checked dns server and don’t have any redirect This is my domain configuration: server { listen 80; server_name latena.vn; root /var/www/latena.vn/htdocs; index index.php index.html index.htm; include common/php-hhvm.conf;
include common/locations.conf; include /var/www/latena.vn/conf/nginx/*.conf; }

server { listen 443 ssl spdy; server_name latena.vn; ssl_certificate /etc/nginx/ssl/latenavn_chain.crt; ssl_certificate_key /etc/nginx/ssl/latena_vn.key; ssl_session_cache shared:SSL:20m; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers “EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS”; ssl_buffer_size 8k; ssl_stapling on; ssl_stapling_verify on; ssl_trusted_certificate /etc/nginx/ssl/latenavn_chain.crt; resolver 208.67.222.222 208.67.220.220 8.8.8.8 8.8.4.4; ssl_dhparam /etc/nginx/ssl/dhparam.pem; root /var/www/latena.vn/htdocs; index index.php index.html index.htm; include common/php-hhvm.conf;
include common/locations.conf; include /var/www/latena.vn/conf/nginx/*.conf; add_header Strict-Transport-Security “max-age=31536000”; } Please help me resolve this error Thankyou



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In my case, It worked after replacing try_files $uri/index.html $uri @puma line. Note:- replace @puma with your respective block.

Great that help me out too. Thanks!

help me

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.