nuxt can't route to page if dot in query string

Viewed 314

I have a nuxt project that uses the file system routing. We had an issue with 301 redirects appending a trailing slash to the end of urls. so we added

generate: {
     subFolders: false
  }

to the nuxt.config.js file and that solved the 301 issue, however it broke paid ad links that contain a '.' dot in the query string. Since the urls are generated we can't url encode the dot.

It seems to only be an issue with pages that have subpages because it forces a trailing slash on the url.

The error on the page just shows: Cannot GET /enroll/

/enroll/?. breaks and shows an error

when I try /enroll?. it redirects to /enroll/?.

if there is no period it redirects to /enroll?q=blabla

if I comment out the subfolders: false then

/enroll/?. redirects to /enroll?.

Any help would be appreciated.

Edit: nginx conf

        listen 80;
        listen [::]:80;
        server_name _;
        #if ($http_x_forwarded_proto = 'http'){
        #       return 301 https://$host$request_uri;
        #}
        root /usr/share/nginx/html/cosi-cbr/main/html;
        index index.php index.html;


        server_tokens off;

        error_log /var/log/nginx/cosi-cbr-main.axervices.com_error.log;
        access_log /var/log/nginx/cosi-cbr-main.axervices.com_access.log;

        gzip            on;
        gzip_types      text/plain application/xml text/css application/javascript;
        gzip_min_length 1000;

        location /robots.txt {
                auth_basic off;
                access_log off;
                return 200  "User-agent: *\nDisallow: /\n";
        }

        location / {
                expires                             $expires;
                proxy_redirect                      off;
                proxy_set_header Host               $host;
                proxy_set_header X-Real-IP          $remote_addr;
                proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto  $scheme;
                proxy_read_timeout                  1m;
                proxy_connect_timeout               1m;
                proxy_pass                          http://127.0.0.1:3000; # set the address of the Node.js instance here
                auth_basic                          "Restricted Content";
                auth_basic_user_file                /etc/nginx/.htpasswd;
        }
0 Answers
Related