Wie um zu testen, nginx subdomains auf localhost

Will ich testen nginx subdomains vor dem Upload der config auf dem server. Kann ich es testen auf localhost? Ich versuche

server {
    listen       80;
    server_name  localhost;

    location /{
        proxy_pass http://localhost:8080;
    }
}

server {
    listen       80;
    server_name  sub.localhost;

    location /{
        proxy_pass http://localhost:8080/sub;
    }
}

Und es funktioniert nicht. Shoulld ich meine hosts-Datei um, damit es funktioniert? Auch, nach dem hochladen der site auf den server sollte ich ändern, DNS-Einträge und hinzufügen sub.mydomain.com?

InformationsquelleAutor der Frage madhead | 2012-04-10

Schreibe einen Kommentar