question

33810499 avatar image
0 Votes"
33810499 asked 33810499 commented

IIS Reverse proxy settings for blazor server

I wanted to link other port's site with 80 port
So i setted reverse proxy that pattern like "(example.*)" url rewrite inside IIS
to link blazor server with "https://www.site.com/example"
but i found that if i do this blazor server can't get resource of itself
122128-image.png



Blazor wants to get resource of itself but it doesn't try to get by localhost or it's own port.

I heard there's a way to connect IIS with nodeJS server with reverse proxy settings.
(https://docs.microsoft.com/en-us/answers/questions/507816/can-static-iis-php-server-and-nodejsexpress-server.html)
And is there a way to reverse proxy with Blazor server project?

windows-server-iisdotnet-aspnet-core-blazor
image.png (30.6 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please make sure your Mime type in IIS are correct or you have added the MIME type accordlingly please refer to this document https://docs.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap

0 Votes 0 ·

1 Answer

Bruce-SqlWork avatar image
1 Vote"
Bruce-SqlWork answered 33810499 commented

as Blazor server is an asp.net core signal/r app not sure why you want to reverse proxy. But you must configure IIS reverse proxy for single/r.

https://stackoverflow.com/questions/41566472/signalr-with-iis-10-and-arr-3-0

also special care must be taken if you you configure the reverse proxy as a subsite (/example). the easiest if the site you are reverse proofing to uses the same subsite. be sure all html links are relative.

we could help more if you gave more info:
1) the Blazor server site url (I assume its another computer or it would be hosted directly)
2) the IIS reverse proxy site url for the Blazor app
3) the reverse proxy settings.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Because the server was running by static way already. And i wanted to add(attach) server to previous one...
This is why i started this journey...

Thanks for the reply first.

1) the Blazor server site url (I assume its another computer or it would be hosted directly)
Legacy static site have all url paths. and if i can i want to add blazor server as subsite
ex) main
www.mysite.com
blazor server
www.mysite.com/blazor/.*
- only occupies below all "blazor/"

2) the IIS reverse proxy site url for the Blazor app
The main server is running on IIS server with www.mysite.com
And blazor server is running on IIS server with port 3000(www.mysite.com:3000(there's a ssl problem also.. but let's mention this later)

3) the reverse proxy settings.
I've used URL Rewrite one of IISServer function.
URL search pattern was like
subsite/(.*)
and task's url rewrite attribute is
http://www.mysite.com/subsite/{R:1}

I used this settings for main Server's subsite server(which run by nodeJS).
That worked well but blazor wasn't.
Does reverse proxy setting breaks blazor's signal/r connections?

0 Votes 0 ·