Skip to content

Instantly share code, notes, and snippets.

@wesort
Last active October 10, 2019 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesort/a10c1d6edf62bc693fb7015cdd0dde2a to your computer and use it in GitHub Desktop.
Save wesort/a10c1d6edf62bc693fb7015cdd0dde2a to your computer and use it in GitHub Desktop.
The part of nginx.conf on forge.laravel.com for static sites.
location / {
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1?$args;
}
try_files $uri $uri.html $uri/ =404;
}
error_page 404 /404.html;
@wesort
Copy link
Author

wesort commented Oct 10, 2019

Replace the snippet below with the gist above

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

Now delete the following line (around line 40)

error_page 404 /index.php;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment