Meaning of mg_serve_http_opts.index_files?

II’m running esp32 with freeRTOS, using ESP-IDF with mongoose.h (6.14).
My s_opts.index_files points to “/index.html”.
So far, I expected that index.html will be served wenn the server is
called like http://myserver.mynet.site, but it doesn’t.

http://myserver.mynet.site/index.html serve the site well.

So I’m not sure about the meaning of “s_opts.index_files = “/index.html”;”

Code:

void mongooseTask(void *data)
{
struct mg_mgr mgr;
mg_mgr_init(&mgr, NULL);
struct mg_connection *nc = mg_bind(&mgr, “:80”, mongoose_event_handler);
if (nc == NULL) {
printf( “No connection from the mg_bind()\n”);
vTaskDelete(NULL);
return;
}

mg_set_protocol_http_websocket(nc);
memset(&s_opts, 0, sizeof(s_opts));
s_opts.document_root= “/spiffs/”;
s_opts.index_files = “/index.html”;
s_opts.enable_directory_listing = “yes”;
printf(“mg goes polling … \n”);
while (1) {
mg_mgr_poll(&mgr, 200);
}
mg_mgr_free(&mgr);
}

Extra Flags:
CFLAGS += -mlongcalls -DESP_PLATFORM=1 -DMG_ENABLE_HTTP=1 -DMG_ENABLE_FILESYSTEM=1f you are asking a question, please follow this template: