Couldn't you run Termux, pick a distro, install it with proot or something, and then host any servers you want?
It seems like unforeseen complexity from that would come from mobile providers allowing the ports needed, and DDNS; if you want it public.
Although I wonder if something wild like hosting a server at a known location (VPS), using a VPN from your phone to that server, and then having DDNS and all that go to that server and be forwarded (proxy?) to the phone? Can maybe even set something up to show site viewers the page isn't available until you connect back to wifi if your phone isn't connected to the VPN or if the server can't proxy the requests to it.