2016-10-09 5 views
0

Ich möchte den "neuen" ASP.NET Core auf meinem Ubuntu-Server testen. Ich benutze Apache, aber die offizielle Dokumentation (https://docs.asp.net/en/latest/publishing/linuxproduction.html) deckt nur Nginx ab. Kann mir jemand helfen, die Nginx-Konfiguration für den Reverse-Proxy zu einem Apache VHost zu "übersetzen"?ASP.NET Core Apache Reverse Proxy für Kestrel

server { 
    listen 80; 
    location/{ 
     proxy_pass http://localhost:5000; 
     proxy_http_version 1.1; 
     proxy_set_header Upgrade $http_upgrade; 
     proxy_set_header Connection keep-alive; 
     proxy_set_header Host $host; 
     proxy_cache_bypass $http_upgrade; 
    } 
} 

Quelle: ASP.NET Core-Dokumentation (siehe oben)

Für SSL: https://docs.asp.net/en/latest/publishing/linuxproduction.html#configure-ssl

+0

Ich bin nicht persönlich mit Apache vertraut, also hinterlasse einen Kommentar anstatt eine Antwort, aber dieser Beitrag scheint Ihnen zu geben, was Sie wollen: http://tattocoder.com/using-apache-web-server-as-reverse- Proxy-für-Aspnetcore /. –

Antwort

0

Die verfügbare Dokumentation für den (noch ziemlich neu) ASP.NET-Core gewesen aktualisiert seit ich diese Frage gestellt habe. Hier zwei Links zu Artikeln (Danke an David Peden), die die notwendige Konfiguration für Apache erklären. Obwohl sie auf CentOS zielen, ist es kein Problem, sie für Ubuntu zu verwenden.

0

können Sie Proxy library for ASP.NET Core

app.UseWebSockets() 
    .Map("/api", api => api.RunProxy(new Uri("http://localhost:8833"))) 
    .Map("/image", api => api.RunProxy(new Uri("http://localhost:8844"))) 
    .Map("/admin", api => api.RunProxy(new Uri("http://localhost:8822"))) 
    .RunProxy(new Uri("http://localhost:8811")); 

prüfen detaillierter here verwenden.

Verwandte Themen