Base solution for your next web application
Open Closed

Issues about deploy ASP.NET Core & Angular in intranet #4052


User avatar
0
jizhongqi created

Dear Support, I got some trouble when I deploy the asp.net core & Angular solution in my company intranet, eg. ASP.Net Core and Angular run separately, asp.net core running at <a class="postlink" href="http://localIP(192.168.0.19">http://localIP(192.168.0.19</a>):22742, angular running at <a class="postlink" href="http://localIp(192.168.0.10">http://localIp(192.168.0.10</a>):4200, in order to let the users can access the website hosted on the intranet server: 192.169.0.10:4200, I have to mapping the intranet angular 4200 port to outside internet domain name, eg, <a class="postlink" href="http://aspnetzero.free.ngrok.cc">http://aspnetzero.free.ngrok.cc</a>, which is mapping to intranet ip 192.168.0.10:4200, ideally if we access <a class="postlink" href="http://aspnetzero.free.ngrok.cc">http://aspnetzero.free.ngrok.cc</a> from internet, it should work and display the angular login page, but it displayed an error messagebox (attached). meanwhile if I access the same url from intranet(where my local server is running) it works fine. since the production network infrastructure will be similar to this, and I have spent several days to investigate this issue, and couldn't find the root cause, please help and see how to solve this issue. if you need more information, please let me know, many thanks for your help!


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @jizhongqi,

    Do you have any error message on Logs.txt under your deployed host project ?

  • User Avatar
    0
    jizhongqi created

    Hi ismcagdas, In order to check logs, I deleted the old log, and then tried to access from internet, I didn't find any log generated in the folder App_Data\Logs, it seems the request didn't forward to asp.net core project at all, is there any log for angular project? i don't know how to check.

    by the way, if you can setup the same web app service? it can duplicate the issue very easily.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you try to add <a class="postlink" href="http://aspnetzero.free.ngrok.cc">http://aspnetzero.free.ngrok.cc</a> (your public address) to CORS configuration of your host project ?

    "CorsOrigins": "http://localhost:4200,http://aspnetzero.free.ngrok.cc"
    

    If it is working locally, probably there is something with the configuration.