JosephSilber / page-cache

Caches responses as static files on disk for lightning fast page loads.
MIT License
1.21k stars 118 forks source link

NGINX duplicate location "/" #54

Closed audetcameron closed 4 years ago

audetcameron commented 4 years ago

In forge when trying to add

location = / {
    try_files /page-cache/pc__index__pc.html /index.php?$query_string;
}

location / {
    try_files $uri $uri/ /page-cache/$uri.html /index.php?$query_string;
}

I get an nginx error "duplicate location /

Is this a new problem with NGINX? Is there a way to account for the home page and all other pages? Thanks in advance.

audetcameron commented 4 years ago

I'm silly, not your fault. We were using

rewrite ^/(.*)/$ /$1 permanent;

to end trailing slashes, this was causing the issue.