Question: Can I use this for Intercom Custom Domain? #681
-
Hi, I'm sorry if this is not the right place to ask this question but I do think that others will search for this use case and that an answer may help more people than only myself. I'm using a third party product on my site: Intercom. It's a live chat messenger that you can embed on your webpage. It supports help articles to be hosted at a custom domain: https://intercom.help/your-company (by default). They also support custom domains so that you can show the help portal on help.your-company.com but that requires a reverse proxy in order for SSL to work. They supply a guide for custom SSL using a reverse proxy configured in Apache and nginx but not for anything in .NET Core. I thought YARP would help me host this in an Azure Web App running .NET 5. I followed the YARP getting started guide but I only get 404 on my site and I have no clue on where to start troubleshooting this. The nginx example is like this:
I have this code in Startup.cs of my .NET 5 application: public class Startup
{
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddReverseProxy().LoadFromConfig(Configuration.GetSection("ReverseProxy"));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapReverseProxy();
});
}
} And I have this ReverseProxy section in my appsettings.json: "ReverseProxy": {
"Routes": [
{
"RouteId": "route1",
"ClusterId": "cluster1",
"Match": {
"Path": "{**catch-all}"
}
}
],
"Clusters": {
"cluster1": {
"Destinations": {
"cluster1/destination1": {
"Address": "https://custom.intercom.help/"
}
}
}
}
} Could this work or am I completely missing the point here? :) Any help is greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Converting to a discussion, as this is a troubleshooting question. Do you have the output from the console (or logging if hosted) from the proxy when the server is started up, and the request is made to it.
At the top of your config file to get additional log messages. This will then tell you more about what the server is up to, and details for each request. |
Beta Was this translation helpful? Give feedback.
-
I would suggest you try using cURL or postman to figure out how to craft requests that are successful with the destination server, and then map those back to YARP once you understand exactly what is needed. It may be the config for certs etc on the destination server that needs tweaking. |
Beta Was this translation helpful? Give feedback.
Converting to a discussion, as this is a troubleshooting question.
Do you have the output from the console (or logging if hosted) from the proxy when the server is started up, and the request is made to it.
You might want to stick
At the top of your config file to get additional log messages. This will then tell you more about what the server is up to, and details for each request.