1

I want to test the "new" ASP.NET Core on my Ubuntu server. I use Apache, but the official documentation (https://docs.asp.net/en/latest/publishing/linuxproduction.html) only covers Nginx. Can somebody help me to "translate" the Nginx configuration for the reverse proxy to an Apache VHost?

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;
    }
}

Source: ASP.NET Core Documentation (see above)

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

  • I'm not personally familiar with Apache so leaving a comment rather than an answer but this post appears to give you what you want: http://tattoocoder.com/using-apache-web-server-as-reverse-proxy-for-aspnetcore/. – David Peden Jan 04 '17 at 21:45

2 Answers2

1

You can use 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"));

Check for more detail here.

Kerem Demirer
  • 996
  • 1
  • 10
  • 24
0

The available documentation for the (still rather new) ASP.NET Core have been updated since I've asked this question. Here a two links to articles (thanks to David Peden) that explain the needed configuration for Apache. Even though they target CentOS, it is no problem to use them for Ubuntu.