Question
Config en nginx cause ERR_TOO_MANY_REDIRECTS.
Hi. sorry for my bad English. I’m getting the following error on my site.
Esta página web tiene un bucle de redirección
ERRTOOMANY_REDIRECTS.
I configured nginx I have 2 domains following this tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-lts
the url that gives the error is drupal-test.libre.coop
servers blocks are:
drupal-test.libre.coop.conf
server {
listen 80;
listen [::]:80;
server_name drupal-test.libre.coop;
#server_name 107.170.12.18;
root /usr/share/nginx/html/drupal-test.libre.coop;
index index.php index.html index.htm;
access_log /var/log/drupaltest/drupaltest.access.log;
error_log /var/log/drupaltest/drupaltest.error.log;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html/drupal-test.libre.coop;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-107.170.12.18.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
mapa.conf
server {
set $site_name 107.170.12.18;
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
# listen *:80;
# server_name 107.170.12.18;
server_name mapatest.libre.coop;
access_log /var/log/mapasculturais/mapa.access.log;
error_log /var/log/mapasculturais/mapa.error.log;
index index.php;
root /srv/mapas/mapasculturais/src/;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff)$ {
expires 1w;
log_not_found off;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm-$site_name.sock;
client_max_body_size 20M;
}
charset utf-8;
}
server {
listen *:80;
server_name 107.170.12.18;
return 301 $scheme://107.170.12.18$request_uri;
client_max_body_size 20M;
}
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.
×