qfieldcloud icon indicating copy to clipboard operation
qfieldcloud copied to clipboard

Port configuration behind a reverse proxy

Open qwenger opened this issue 7 months ago • 0 comments

I'm deploying qfieldcloud on-premise, behind an nginx reverse proxy. I get into the following circular error:

  • QFIELDCLOUD_HOST is meant to be the client-facing host.
  • hence in docker-nginx/templates/default.conf.template:47 and following, $http_host also has to be the client-facing host, and similarly WEB_HTTP(S)_PORT are meant to be public ports, e.g. 80 for 443 for standard production deployments
  • however, WEB_HTTP(S)_PORT are also used in docker-compose.yml:103 for docker ports, which in typical reverse proxy scenarii have to be non-standard, e.g. 8080 and 8443.

If I set proxy_set_header Host $http_host; in the reverse proxy I can get to the web interface (else the connection completely fails). But then I also have to bypass the port check in docker-app/qfieldcloud/filestorage/view_helpers.py:213 for file synchronisation to work. That's a hack.

What are the proper env and header settings in a reverse proxy situation where docker ports are not 80/443? Does it necessarily involve changing one of default.conf.template, view_helpers.py or docker-compose.yml? Or is that setup not supported at all?

qwenger avatar Mar 28 '25 16:03 qwenger