Last active
June 11, 2021 23:46
-
-
Save RienNeVaPlus/c830d443bb25bb94eaa8f751c1bd63dd to your computer and use it in GitHub Desktop.
How-to configure Mail-in-a-Box (MIAB) nginx to work with StencilJS or any other JavaScript router that requires a single entry point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
index index.html; | |
try_files $uri $uri/ /index.html; | |
} |
Note: it's required to rename the conf
file after editing it, otherwise the changes won't get picked up by the web_update
script.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How-to configure mailinabox's nginx to work with StencilJS
...or any other JavaScript router that requires a single entry point (index.html)
Mailinabox's default nginx config depends on file name extensions. However, nowadays most applications require a single entry point (index.html) for all routes to work properly. Luckily there is an unsupported feature that let's you create custom nginx configs for your mailinabox hosts.
Setup
/home/user-data/www/example.com/
www
directory, for example/home/user-data/www/example.com.conf
/root/mailinabox/tools/web_update
All routes should now redirect to your
index.html
and you're good to go.