Is there a way to run a capacitor PWA from a subfolder of the web server?

Hello, everybody

I have developed a PWA app with Ionic/capacitor/Angular. I have tested it in the root of a subdomain of my web server and it runs fine. I am now trying to install it in the customer’s server. The server admin has assigned me a subdirectory of the web server’s root dir. Assigning a new subdomain would mean getting new certificates, which he wants to avoid. I have copied the app to the subdirectory and, after making some changes, it runs fine as a web page. However, it doesn’t seem to run as a PWA. For example, when I save the app to the home screen of an android device, it only runs with the server running. If the server is stopped, it produced a 404 page. Also, when I make a change to the server image, tapping on the saved app image runs tthe new version immediately (with a PWA, it will run the saved version, and run the new version the next time).

Is there a way to run a PWA that is stored in a subfolder?

Best regards,

Among other things, I have tried the following:


  <base href="/my/sub/folder/"/> <!--  <<<<<<<<<< Added this line -->


  "start_url": "https://my.web.server/my/sub/folder",


    imports: [
                   '/my/sub/folder/ngsw-worker.js', {


  "projects": {
    "app": {
      "architect": {
        "build": {
          "options": {
            "baseHref":"/my/sub/folder/", // <<<<<<<<< Added this line