I wasn't able to find an immediate solution to the 3rd item, below, so once I'd worked it out, I thought it would be helpful to post my general config for Laravel in order to help others searching for the same.
These settings would suit sysadmins seeking an SEO friendly Laravel setup. It isn't an exhaustive example; just a bare bones config to meet the requirements below. Fill in the remainder yourself.
How would one configure nginx for Laravel, in order to:
- Redirect all requests to serve a site at
https://www.example.com
? - Access files directly, falling back to the central index.php controller?
- Strip index.php from requests which include it?
- Remove the trailing slash (/) from URIs.