minds
minds copied to clipboard
(#134) Added nginx-based auto-language negotiation for /.
The Problem: Upon following the directions to the letter, when I go to http://localhost:8080/ I get a 403: Forbidden nginx error screen.
The Reason: No language detection / negotiation is done, and / is empty.
The Solution: I added nginx-based language negotiation using the browser's
Accept-Language
header. If the user does not set a header (some search engines,
curl, etc.), it will show the English page.
This only applies to the / route. It is assumed that any other route will be in the desired language.
Now, http://localhost:8080/ will redirect to http://localhost:8080/en/.
IMPORTANT: You must manually remove your minds_nginx
image and rebuild it.
Fixes #134.
Was the index.php returning the error or where the assets? I believe that https://github.com/Minds/engine/commit/b7bf6504305b5649875a9e11f01adbf8baf65100 should resolve that issue
in general I think a step in the build scripts (like ONBUILD
in docker) could compile the list of languages and get it included in the main nginx configuration, that way the code generation will not have a chance to break the main config