Nginx-Installation auf Ubuntu gibt 500 Fehler

Nginx-Installation auf Ubuntu gibt 500 Fehler

Ich habe gerade Nginx auf Ubuntu 12.04 LTS installiert. Wenn ich auf localhost zugreife, erhalte ich:

500 Interner Serverfehler nginx/1.2.3

error_log hat Folgendes

Umschreiben oder interner Umleitungszyklus bei interner Umleitung zu "/index.html", Client: 127.0.0.1, Server: localhost, Anfrage: "GET / HTTP/1.1", Host: "localhost"

Dies ist die Standardkonfiguration von nginx: nginx.conf hat:

    include /etc/nginx/sites-enabled/*;

/etc/nginx/sites-enabled/default hat folgendes

    root /usr/share/nginx/www;
    index index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;
    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
    }

Antwort1

Nginx hat den Standardsitenamen direkt von www in html geändert.

root /usr/share/nginx/www;

Sollte geändert werden in

root /usr/share/nginx/html;

Antwort2

Für diese einfache Konfiguration benötigen Sie den Standortblock und die Try_Files überhaupt nicht.

verwandte Informationen