Open Closed

Routing not working in IIS #2096


User avatar
0
devraj.np@gmail.com created
  • UI type: Angular / MVC / Blazor
  • DB provider: EF Core / SQL Server I have deployed my angular+dotnetcore app into IIS. You can find the public link here http://116.90.234.198:8080/ , Home, FAQ, Report a Bug are being browsed as they are angular page but if i click on login it is not being routed. However if i type the url http://116.90.234.198:8080/account/login i can browse it. My HTTP Api Module is as follows
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

23 Answer(s)
  • User Avatar
    0
    bunyamin created

    Hello,

    Since you are not using HTTPS yet, you need to set requireHttps to false in environment.prod.ts as follows:

    export const environment = {
      // ...
      oAuthConfig: {
        // ...
        requireHttps: false
      },
    
      // ...
    } as Config.Environment;
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    got this after setting require https to false

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    bunyamin created

    Could you share the logs of the request to see why it has failed?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    Please find the logs in the link https://drive.google.com/file/d/1N0hRV1y2P2V4nyyJHNQl8O824wyQ5tyX/view?usp=sharing

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    bunyamin created

    The log states that you have not set redirect uri properly.

    Invalid redirect_uri: http://116.90.234.198:8080 {"ClientId":"BMP_App","ClientName":"BMP_App","RedirectUri":null,"AllowedRedirectUris":["http://localhost:4200"]

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    This is my enviroemnt.prod.ts file. where do i set the redirect uri ?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    bunyamin created

    That's config file for angular application. You need to edit redirect uri in appsettings.json.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    I couldnt find that key in appsettings.json. Kindly provide a doc or example of the same.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    Can i have an update please- still my error is** An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.**

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @devraj.np@gmail.com, does your problem can be related with https://support.abp.io/QA/Questions/1009/Invalid-redirecturi---RedirectAllowedUrls-on-Login-page?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    Hi , I have already done that but it's not working. Actually non of my deployement is working in IIS, i also have other mvc prroject deployed but error is same. this error was from angular +dotnetcore. Please provide me remote support to sort it out, im in a bit of trobule since has been pending for some time.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, did you add the url http://116.90.234.198:8080 into the RedirectAllowedUrls section of your package.json file? (in HttpApi.Host project)

    {
      "App": {
        "SelfUrl": "https://localhost:44326",
        "AngularUrl": "http://localhost:4200",
        "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,http://116.90.234.198:8080",
        "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307,http://116.90.234.198:8080"
      },
      //...
    }
    

    Also add this url to CorsOrigins section.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    Yes, but doesn't work. Screenshot of the Appsettings.json

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Does the error still same?

    Btw, you should specify the SelfUrl as your HttpApi.Host url not Angular project url.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    My Angular and API are are hosted in the same node in the IIS - so do i have to keep the angular url empty ? I tried removing the key it doesn't work.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    I used to recieve remote support previously - why is this time support is not paying attention and not trying to solve the problems. i already know these answers.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    My Angular and API are are hosted in the same node in the IIS - so do i have to keep the angular url empty ? I tried removing the key it doesn't work.

    No, they both need to be the same then.

    Did you change your appsettings.json when migrating the database (in DbMigrator project)?

    {
      "ConnectionStrings": {
        "Default": "Server=localhost;Database=MyApp;Trusted_Connection=True"
      },
      "IdentityServer": {
        "Clients": {
          //...
          "MyProjectName_App": {
            "ClientId": "MyProjectName_App",
            "RootUrl": "http://116.90.234.198:8080" //change root url
          },
          //...
        }
      }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    App settings of migrator App config of the host Angular prod Config Table for the ClientRedirectURIS Any other info you need please let me know ..

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    Have been waiting on this!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    bunyamin created

    Have been waiting on this!

    We have discussed your problem and it looks like this article may solve your issue.

    https://community.abp.io/articles/patch-for-chrome-login-issue-identityserver4-samesite-cookie-problem-weypwp3n

    Could you please try it out and post the results?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    2021-11-20 12:08:28.756 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:08:28.792 +05:45 [ERR] Connection ID "16645304232961901151", Request ID "80000260-0002-e700-b63f-84710c7967bb": An unhandled exception was thrown by the application. System.Threading.Tasks.TaskCanceledException: A task was canceled. at Volo.Abp.Threading.SemaphoreSlimExtensions.LockAsync(SemaphoreSlim semaphoreSlim, CancellationToken cancellationToken) at Volo.Abp.Caching.DistributedCache2.GetOrAddAsync(TCacheKey key, Func1 factory, Func1 optionsFactory, Nullable1 hideErrors, Boolean considerUow, CancellationToken token) at Volo.Abp.LanguageManagement.DatabaseLanguageProvider.GetLanguagesAsync() at Microsoft.AspNetCore.RequestLocalization.DefaultAbpRequestLocalizationOptionsProvider.GetLocalizationOptionsAsync() at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync() 2021-11-20 12:08:38.951 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:08:48.976 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:08:58.989 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:09.002 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:19.015 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:29.028 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:39.042 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:49.071 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:09:59.084 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:10:09.097 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:10:19.110 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration) 2021-11-20 12:10:29.124 +05:45 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BMP Health Status. System.InvalidOperationException: An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReport(HealthCheckConfiguration configuration)

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    devraj.np@gmail.com created

    Still getting the same error, i notices a weird fact. All get actions are completed, for e.g in the screenshot below i can get values in the dropdown but i cannot do a post. Maybe this would help.. the error is still same in the log.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi,

    Have tried to configure your web.config like following topic: https://stackoverflow.com/a/44473484/7200126

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 21, 2026, 06:18
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.