下面是我拥有的 inets 配置文件:
[{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}
].
使用此配置文件,我可以访问:
https://example.com/cgi-bin/something.cgi
and
https://example.com/erl/functions/function
我已经知道将**{script_alias,{"/cgi-bin/"...更改为{script_alias,{"/"...可以从https://example.com/
访问cgi脚本,但如何使用erl_script_alias**获得相同的行为?例如:访问https://example.com/
和访问/erl/functions/function
?
1条答案
按热度按时间50few1ms1#
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.