[Solved] Frigate, how to access remotely?

Hello,

I have setup frigate on nixos using the package. The service starts correctly,

Jan 01 19:07:00 nas systemd[1]: Starting frigate.service...
Jan 01 19:07:00 nas systemd[1]: Started frigate.service.
Jan 01 19:07:01 nas frigate[1414219]: 2026-01-01 19:07:01.761553: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
Jan 01 19:07:01 nas frigate[1414219]: To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Checking if frigate config needs migration...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : copying config as backup...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Migrating frigate config from 0.13 to 0.14...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Migrating export file names...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Migrating frigate config from 0.14 to 0.15-0...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Migrating frigate config from 0.15-0 to 0.15-1...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Migrating frigate config from 0.15-1 to 0.16-0...
Jan 01 19:07:10 nas frigate[1414219]: [2026-01-01 19:07:10] frigate.util.config            INFO    : Finished frigate config migration...
Jan 01 19:07:12 nas frigate[1414219]: [2026-01-01 19:07:12] frigate.util.services          INFO    : Automatically detected nvidia hwaccel for video decoding
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] frigate.app                    INFO    : Starting Frigate (0.16.3)
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] peewee_migrate.logs            INFO    : Starting migrations
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] peewee_migrate.logs            INFO    : There is nothing to migrate
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] frigate.app                    INFO    : Recording process started: 1416043
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] frigate.app                    INFO    : Review process started: 1416055
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] frigate.app                    INFO    : go2rtc process pid: 1360971
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] frigate.app                    INFO    : go2rtc process pid: 3291005
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] detector.coral                 INFO    : Starting detection process: 1416067
Jan 01 19:07:17 nas frigate[1414219]: [2026-01-01 19:07:17] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
Jan 01 19:07:18 nas frigate[1414219]: [2026-01-01 19:07:18] frigate.app                    INFO    : Output process started: 1416084
Jan 01 19:07:18 nas frigate[1414219]: [2026-01-01 19:07:18] frigate.app                    INFO    : Camera processor started for maingate: 1416108
Jan 01 19:07:18 nas frigate[1414219]: [2026-01-01 19:07:18] frigate.app                    INFO    : Capture process started for maingate: 1416132
Jan 01 19:07:18 nas frigate[1414219]: [2026-01-01 19:07:18] frigate.api.fastapi_app        INFO    : Starting FastAPI app
Jan 01 19:07:18 nas frigate[1414219]: [2026-01-01 19:07:18] frigate.api.fastapi_app        INFO    : FastAPI started
Jan 01 19:07:20 nas frigate[1414219]: [2026-01-01 19:07:20] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
Jan 01 19:07:20 nas frigate[1416067]: INFO: Created TensorFlow Lite XNNPACK delegate for CPU.

Also, i see that a service starts to listen on port 5000,

#ss -atn|grep 5000
LISTEN     0      511                               127.0.0.1:5000                 0.0.0.0:*  

I want to access this server through nginx proxy. The upstream documentation says that i need to use port 8971 to access the web ui. However, i dont see this port listening. I want to proxy through https instead of http.

How does one access the frigate server remotely?

The only way i could get frigate on https was with following nginx snippet,

"cam.domain.com" = {
    # Force HTTPS
    forceSSL = true;
    
    basicAuth = {
      admin = "password";
    };
    
    locations."/" = {     
      proxyPass = "http://127.0.0.1:5000";
      proxyWebsockets = true;
    };
  };

Also i have the following defined for frigate,

ervices.frigate.hostname = "localhost";

This uses basicAuth instead of the better Auth module of frigate. Is there a way to use it with nixos module?

Figured it out. Here is what is needed,

services.frigate.hostname = "cam.domain.com";
services.nginx.virtualHosts."cam.domain.com" = {    
      listenAddresses = ["0.0.0.0"];   
      forceSSL = true;    
    };