Here is the inets configuration file that I have:
[{port, 443},
{server_name, "example.com"},
{server_root, "./root/"},
{document_root, "./htdocs/"},
{socket_type, {essl, [{certfile, "/etc/letsencrypt/live/example.com/cert.pem"}, {keyfile, "/etc/letsencrypt/live/example.com/privkey.pem"}]}},
{directory_index, ["index.html"]},
{erl_script_alias, {"/erl",[functions]}},
{erl_script_nocache, true},
{script_alias, {"/cgi-bin/", "/home/example/site/cgi-bin/"}},
{script_nocache,true}
].
With this configuration file I can access:
https://example.com/cgi-bin/something.cgi
and
https://example.com/erl/functions/function
I already know that changing {script_alias, {"/cgi-bin/"... to {script_alias, {"/"... gives me access to cgi script from https://example.com/
, but how can I get the same behavior with erl_script_alias? Ex.: accessing https://example.com/
and getting access to /erl/functions/function
?
Answering my own question:
The solution that I found was to create a module to deal with "GET" requests of "/".
And adding the module into the configuration file with the default modules:
As the documentation says, the modules' order matters.