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

1
  • 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: tattoocoder.com/…. Commented Jan 4, 2017 at 21:45

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.