nginx php 500

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Error code: 500

The error log: rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 192.168.190.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.190.142"

Solution: to modify the /etc/nginx/sites-available/default file

The

    location / { 
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
       try_files $uri $uri//index.html;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }   

Change

    location / { 
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
#       try_files $uri $uri//index.html;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
        if (!-e $request_filename) {
            rewrite ^/(.*) /index.php last;
        }   
    }   


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Steward at January 06, 2014 - 5:10 AM