URL query strings not working (pagination)

Posted 2 years ago by Kryptonit3

I built a warehouse management site for my previous company and they have recently expanded into another market. I had the original site on the base domain https://gandc.co now that they have opened a shop in another market I moved the base domain code to a subdomain https://louisville.gandc.co - The site 99% works as it should. I did migrate all the code to a new digital ocean droplet. My previously working install on the base domain was running Ubuntu 14.04 with nginx, mysql, and php 5.x . On the new server I decided to go with the new Ubuntu 16.04. Its default PHP is version 7. I think this may be my issue but not sure as to why due to my nginx configs staying the same.

If I go to a page with paginated data and click "2", the url will append with myurl.com?page=2 but the data doesn't change. It is like PHP or nginx isnt passing the URL query string.

Here is my nginx config in question. Worked fine on old server with older PHP

server {
    listen 80;
    listen [::]:80;
    server_name louisville.gandc.co;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    charset utf-8;

    ssl_certificate /etc/letsencrypt/live/louisville.gandc.co/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/louisville.gandc.co/privkey.pem;

    include snippets/ssl-params.conf;

    root /var/www/gandc/subdomains/louisville/html/public;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name louisville.gandc.co;

    location / {
        try_files $uri $uri/ /index.php?query_string;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /.well-known {
        allow all;
    }
}

Any ideas? I also switched from using a regular SSL to using https://letsencrypt.org so I wouldn't have to pay high price for wildcard SSL. Also using Laravel Framework version 5.0.35 (older project)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.