-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
My app has 2 gRPC services, one is for external requests with authentication and second for internal requests from other apps without any auth.
My app works in container, so I configure Kestrel for listen 80 and 88 ports (80 for internal requests and 88 for external) and add RequireHost to both services:
app.MapGrpcService<ExternalService>().RequireHost("*:88");
app.MapGrpcService<InternalService>().RequireHost("*:80");My reverse proxy listens 443 port with ssl and proxing request as http to port 88 of my app, but nothing works...
If I change port in RequireHost to 80 - works again.
In debug I see this line:
[Microsoft.AspNetCore.Hosting.Diagnostics] Request starting HTTP/2 POST http://my.external.domain/ExternalService.Sample/Test application/grpc -
And I think that RequireHost uses port from this url (translated via forwarding headers) instead of actual Kestrel port.
How can I filter requests via actual Kestrel port?