The Jetty web server sets the CGI HTTPS environment variable to 'ON', not 'on' like other web servers. This breaks redirects as fossil gets the base URL wrong.

Changing line 811 of main.c to

    if( strcmp(zMode,"on")==0 || strcmp(zMode,"ON")==0 ){

solves the problem.