Move nginx config directives from location to server block
@@ -77,7 +77,6 @@ http {
listen <%= ENV["PORT"] %>;
server_name localhost;
- location / {
root <%= ENV["APP_ROOT"] %>/public;
{{if .PushState}}
@@ -117,17 +116,18 @@ http {
add_header Strict-Transport-Security "max-age=31536000{{if .HSTSIncludeSubDomains}}; includeSubDomains{{end}}{{if .HSTSPreload}}; preload{{end}}";
{{end}}
- {{if ne .LocationInclude ""}}
- include {{.LocationInclude}};
- {{end}}
- }
-
{{if not .HostDotFiles}}
location ~ /\. {
deny all;
return 404;
}
{{end}}
+
+ {{if ne .LocationInclude ""}}
+ location / {
+ include {{.LocationInclude}};
+ }
+ {{end}}
}
}
`
