minds icon indicating copy to clipboard operation
minds copied to clipboard

(#134) Added nginx-based auto-language negotiation for /.

Open hopeseekr opened this issue 6 years ago • 2 comments

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.

hopeseekr avatar Nov 01 '18 01:11 hopeseekr

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

markharding avatar Nov 01 '18 10:11 markharding

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

DaGhostman avatar Dec 20 '18 11:12 DaGhostman