nystudio107 / nginx-craft

An Nginx virtual host configuration for Craft CMS that implements a number of best-practices.
MIT License
310 stars 37 forks source link

Trailing slash directive not on forge example #13

Closed hisnameisjimmy closed 6 years ago

hisnameisjimmy commented 6 years ago

If I'm not mistaken, these appear to be missing from the forge example, and are useful! There in general seems to be a schism between the sites-available/somedomain.com.conf and forge-example/NginxConfiguration.conf, and a lack of explanation for that schism, so I'm not sure if there's a reason or if it was potentially overlooked.

# 301 Redirect URLs with trailing /'s as per https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html
rewrite ^/(.*)/$ /$1 permanent;

# Change // -> / for all URLs, so it works for our php location block, too
merge_slashes off;
rewrite (.*)//+(.*) $1/$2 permanent;
khalwat commented 6 years ago

It looks like they are there to me?

https://github.com/nystudio107/nginx-craft/blob/master/forge-example/NginxConfiguration.conf#L35

I do try to keep the Nginx configuration in sync, but it's really just meant as an example so you can see where the various configs go, since Forge adds their own custom directives.