Magento nginx rewrite or internal redirection cycle while processing "/index.php" -


i'm new magento , nginx, , trying fix broken links on website.

in error log nginx have following:

2017/09/11 17:09:00 [error] 23457#23457: *15 rewrite or internal redirection cycle while processing "/index.php", client: 127.0.0.1, server: localhost, request: "get /index.php http/1.1", host: "localhost", referrer: "http://localhost/princess-highway/"

in default config file nginx have following:

# magento specific nginx config frontend  server {   listen 80;   server_name localhost;   root /var/www/html;    # check if load balancer handled ssl   set $elb_https "off";   if ($http_x_forwarded_proto = "https") {     set $elb_https "on";   }    add_header x-whom $hostname;   client_max_body_size 2m;    location / {     index index.html index.php;     try_files $uri $uri/ @handler;     # testing found online     # try_files $uri $uri/ /index.php?$query_string;     expires 30d; ## assume files cachable   }    ## block access   location /app/                { deny all; }   location /includes/           { deny all; }   location /lib/                { deny all; }   location /media/downloadable/ { deny all; }   location /pkginfo/            { deny all; }   location /report/config.xml   { deny all; }   location /var/                { deny all; }   location /downloader/         { deny all; }   location /errors/             { deny all; }   location /shell/              { deny all; }    location ~ rss/catalog/(review|notifystock) {     deny all;   }    ## disable .htaccess , other hidden files   location  /. {     return 404;   }    ## block api access on non-admin instances   location /api                 { deny all; }    ## block rss feeds   location /rss                 { return 404; }    ## block test scripts   location ^~ /dev/             { return 403; }    ## disable hidden files, git files + composer.json   location ~ /(\.|\.git|composer.json|composer.lock) {     return 404;   }    ## allow access   location /var/google/         { allow all; }    #location /admin {   #  rewrite ^.* http://localhost/factoryx permanent;   #}    #location /factoryx {   #  rewrite ^.* https://ao-admin.ap-southeast-2.staging.factoryx.io/factoryx permanent;   #}    location ~ "^/media/picklists/[a-za-z0-9]{32}/$" {     autoindex on;     autoindex_localtime on;   }    ## magento uses common front handler   location @handler {     rewrite / /index.php;   }    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {     expires 1y;     log_not_found off;   }    ## forward paths /js/index.php/x.js relevant handler   location ~ .php/ {     rewrite ^(.*.php)/ $1 last;   }    location ~ .php$ {     if (!-e $request_filename) { rewrite / /index.php last; }      expires        off;     fastcgi_pass   127.0.0.1:9000;     fastcgi_param  https $elb_https;     fastcgi_param  script_filename $document_root$fastcgi_script_name;     fastcgi_param  mage_run_code default;     fastcgi_param  mage_run_type store;     include        fastcgi_params; ## see /etc/nginx/fastcgi_params     fastcgi_read_timeout 300;   } } 

i have links this: http://localhost/princess-highway/index.php/contacts above link work, actual links on navigation menu take here: http://localhost/princess-highway/contacts omitting index.php link, , 500 bad gateway error.

i'm pretty new let me know if can provide further information.

thanks!

using answer comments need formatting

try adding location

location /princess-highway/ {    rewrite /princess-highway/(.*) /princess-highway/index.php/$1; } 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -