App service
Services/Nginx (Odoo)

Nginx (Odoo) service

Nginx web service in front of Odoo that routes live updates to Odoo's realtime port.

You add this service to a stack, where you choose its version and resources. Each app environment can override them.

On Wodby

How Nginx (Odoo) runs on Wodby

An Nginx server that passes HTTP requests to one linked service. It serves no application files and is not built from a repository.

How it works

  • The required backend link sets NGINX_BACKEND_HOST and NGINX_BACKEND_PORT to the linked service's host and port. They form the only upstream.
  • The service sets NGINX_VHOST_PRESET to http-proxy. Requests are passed to the backend over HTTP with the headers Host, X-Forwarded-For and X-Forwarded-Proto. The backend must listen on the port of its endpoint and should read the scheme and client address from those headers.
  • The preset sets no Upgrade or Connection headers.

The configuration is rendered from templates and environment variables on every start, into /etc/nginx/nginx.conf, /etc/nginx/conf.d/vhost.conf, /etc/nginx/preset.conf and /etc/nginx/upstream.conf. Never edit these files in a running container.

Requests that do not reach the backend

The image's default rules are answered by Nginx itself:

  • /.healthz returns 204. It reports on the proxy, not on the backend.
  • /favicon.ico, /robots.txt, /humans.txt, /ads.txt, /llms.txt, everything under /.well-known/, and paths ending in .flv, .mp4, .m4a or .mov are looked up on the proxy's own disk, where there are no application files: a missing favicon gets an empty image, the others are not found.
  • Other paths that start with a dot are denied, as are wodby.yml and Makefile.

Set NGINX_VHOST_NO_DEFAULTS on the service when the backend must answer these paths itself.

Nginx also adds the response headers X-XSS-Protection, X-Frame-Options, X-Content-Type-Options and a Content-Security-Policy that forbids framing. Set NGINX_HEADERS_CONTENT_SECURITY_POLICY to change the policy, or NGINX_NO_DEFAULT_HEADERS to leave headers to the backend.

Changing configuration

  • Environment variables on the service. The ones that matter most for a proxied application: NGINX_CLIENT_MAX_BODY_SIZE (largest accepted request body), NGINX_BACKEND_FAIL_TIMEOUT, NGINX_SET_REAL_IP_FROM and NGINX_REAL_IP_HEADER, NGINX_GZIP.
  • The two declared config files: the main config template and the virtual host template.

Other services reach the proxy over HTTP on port 80 at the app service's name inside the environment.

Check the result

  • nginx -T prints the configuration in effect, including the upstream.
  • curl -sI localhost/.healthz returns 204 from inside the container.

Nginx for Odoo on Wodby

What this service adds to the Nginx Proxy service it is based on. It is the public entry point of an Odoo app: Odoo's own ports are private.

Rules

Odoo's rules replace the image's http-proxy preset. They are the preset config file of this service and can be overridden there. The preset keeps the name http-proxy (NGINX_VHOST_PRESET), which also makes the image point the app_server upstream at the linked Odoo service's HTTP port.

  • /websocket (live updates: chat, notifications) goes to the Odoo service's gevent port, 8072 (NGINX_ODOO_GEVENT_PORT), with the WebSocket upgrade headers and a one-hour timeout.
  • Everything else goes to Odoo's HTTP port.
  • The scheme and client address that Wodby's gateway received are passed on in X-Forwarded-Proto and X-Forwarded-For, with the original Host; Odoo runs with proxy_mode.
  • Odoo's session_id cookie gets the Secure flag when the visitor used HTTPS; Odoo never sets it itself.
  • Proxy timeouts are 720 s (NGINX_ODOO_PROXY_TIMEOUT); Odoo stops a request after its own limit first.
  • /.healthz returns 204.
  • The image's default rules are off (NGINX_VHOST_NO_DEFAULTS): they would serve /favicon.ico and video files from disk and forbid framing, which Odoo's website editor needs.

Image

The stock Nginx image; nothing is built for this service.

Uploads and timeouts

NGINX_CLIENT_MAX_BODY_SIZE is 128m. Routes allow requests and live updates up to one hour.

Check the result

  • nginx -T shows the rules in effect.
  • In the browser's developer tools, the request to /websocket returns 101.

Overview

Technical profile of Nginx (Odoo)

The versions are the ones you can select for Nginx (Odoo) in a stack or an app environment. The service itself is published in revisions, and a stack references a specific revision.

Service type

App service

Versions

1.31, 1.30

Stacks

Stacks that include Nginx (Odoo)

These public stacks include Nginx (Odoo). You can create an app from a public stack as it is, or add the service to a stack of your own.

Configuration

Nginx (Odoo) service configuration

The Nginx (Odoo) service declares the following. Where a value can be changed, a stack sets it and each app environment can override it.

Technical domains

Wodby gives each public HTTP port a technical domain with a TLS certificate and renews the certificate. A port that the service marks private gets no domain. You can add custom domains.

Configs

3 config files that a stack or an app environment can override.

Service links

Each link is a connection from Nginx (Odoo) to another service. A stack sets which service a link points to. The cards list the public services that can satisfy each link.