hosting: properly encode the REMOTE_ADDR and SERVER_PORT


Use variables received from the frontend nginx to correctly tell the
application where it is running and who it's talking to.