No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Nginx history mode settings when PWA in a subfolder?

    Help
    2
    3
    437
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ssuess
      ssuess last edited by ssuess

      Hi, I have enabled history mode, and it works perfectly in my dev environment, but when I try to upload my build to the server, I get nothing but 404 errors. I am pretty sure the problem is that my app does not live at the top level of this server, but in a subdirectory. (So instead of my site being at https://my.site.net/ it is at https://my.site.net/subfolder/). I have tried adding following to the nginx config, and they all fail in exactly the same way (a bunch of 404 errors):

      location  /subfolder {
         try_files $uri $uri/ /subfolder/index.html;
      }
      
      location  ^~ /subfolder {
         try_files $uri $uri/ /index.html;
      }
      
      location  ^~ /subfolder {
         try_files $uri $uri/ /subfolder/index.html;
      }
      

      Does anyone know how to properly configure this for an app that lives in a subfolder? Thanks!

      qyloxe 1 Reply Last reply Reply Quote 1
      • qyloxe
        qyloxe @ssuess last edited by

        @ssuess try rewrite, with all the base folders you’re using in your quasar app. The trick is, it should be visible from client and accessible from server:

        http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite

        1 Reply Last reply Reply Quote 1
        • ssuess
          ssuess last edited by

          I finally gave up trying to make this work in a subfolder. I made a new subdomain and served it as the top level. Now the location redirects work as expected.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post