abpframework / abp

Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.31k stars 3.32k forks source link

Configure abp asp.net to deploy to with customize base path #18033

Closed anhlee97 closed 5 months ago

anhlee97 commented 6 months ago

Is there an existing article or article request for this?

Describe the article you'd like

I am trying to configure asp.net core application to use Lepton X lite theme to deploy on k8s infrastructure with https://localhost:5000/admin/ instead of https://localhost:5000/.

i try UseBasePath. i work for endpoint but some resource in Theme not work correct .

anhlee97 commented 6 months ago

Please help !

anhlee97 commented 6 months ago

@maliming please help

maliming commented 6 months ago

but some resource in Theme not work correct .

Please share the error info.

anhlee97 commented 6 months ago

@maliming. My goal is deploy my app to nginx proxy subpath. i try use Base Pathimage

but some resource in Lepton Theme css, js is not in base path image

anhlee97 commented 6 months ago

image

maliming commented 6 months ago

Can you try to move the UsePathBase before the UseStaticFiles

anhlee97 commented 6 months ago

i tried by still error image

maliming commented 6 months ago

Please share a simple project on GitHub.

anhlee97 commented 6 months ago

you can view here: https://github.com/anhlee97/AbpNginx.git

anhlee97 commented 6 months ago

image @maliming

maliming commented 6 months ago

It works on my local.

  var rootPath = "/customer/admin";
  app.UsePathBase(new PathString(rootPath));
  app.UseStaticFiles();
image
anhlee97 commented 6 months ago

Thanks @maliming. It's work. but i have another problem when login. image

it return /customer/admin but don't have cookie image

maliming commented 6 months ago

Please check your logs and browser console to see the cookies.

anhlee97 commented 6 months ago

image this is my log. and my cookie image

anhlee97 commented 6 months ago

i try set: RootUrl. it work for login but when i access identity management module it say You are not authenticated! You should sign in to perform this operation. image

anhlee97 commented 6 months ago

image

anhlee97 commented 6 months ago

@maliming please help !!!

maliming commented 6 months ago

Please check your app logs.

anhlee97 commented 5 months ago

HI @maliming , I resolved this problem but i have another. image i try create subfolder. image but it not working

maliming commented 5 months ago

hi

Can you run the abp install-libs command to create the js libs?

anhlee97 commented 5 months ago

Yeah. Thank you ! This is my stupid. I forgot when ci/cd. @maliming So help me another issue.

In my case: i want use app.UsePathBase(new PathString(AdminConst.RootPath)); abp.js : not change appPath . var abp = abp || {}; (function () { /* Application paths *****/ //Current application root path (including virtual directory if exists). abp.appPath = abp.appPath || '/'; } image