The configuration below follows the recommended way in Public access: one name, molesignal.example.com, that the internal DNS resolves to nginx’s internal address 10.0.0.10 and the public DNS to its public address 203.0.113.10. The two server blocks share one certificate and are told apart by their listen addresses. Keep only the location blocks in use.
Shared parts
Put the upstream, the public log format and the rate limit zone in the http block, for example at the top of /etc/nginx/conf.d/molesignal.conf:
Every forwarding location uses the same proxy settings, kept in /etc/nginx/snippets/molesignal-proxy.conf:
Internal entry point
The internal entry point forwards every path, as it would without a public entry point. Live queries are streamed responses and must not be buffered:
Public entry point
The public entry point lists only the paths to open, each taking only the methods it uses. The final location / answers 404 for everything else:
limit_except GET also allows HEAD. To tighten one path by source address, add allow and deny all; to its location, for example to let only the ranges of the Azure service tag AzureBotService reach the Teams callback.
Custom domains of status pages
When a status page uses status.example.org, add a public server for it that opens only the status page’s root paths, endpoints and web files:
When MoleSignal issues the custom domain’s certificate itself, TLS ends on MoleSignal. nginx can then only pass the connection through by SNI with the stream module, sees no paths, and cannot open just the status page. To restrict paths on the entry point, manage the certificate on nginx.
With a single entry point
When nginx has one listen address, tell sources apart by address: keep the open paths of the public server as they are, replace the final location / with one that allows only the ranges of the office network and the VPN, and add the streaming settings for live queries:
Internal requests then pass the same server: raise client_max_body_size to 10m, and expect the access log to record the paths of internal requests too. When a load balancer stands in front of nginx, take the original address with set_real_ip_from and real_ip_header; otherwise allow sees only the load balancer’s address.
Check
Check the configuration and reload it:
From the internet, the sign-in endpoint answers 404:
From the internet, alert intake without a token answers 401, which shows that the request reached MoleSignal:
Finally, in the _sys organization, list nginx’s addresses as trusted proxies under Settings → Client IP recognition, see Client IP recognition. Last modified on October 31, 2026