question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Support]: Instructions for adding a nginx reverse proxy with ssl+auth

See original GitHub issue

Describe the problem you are having

Since the frigate web interface does not support ssl or auth, I am trying to setup a nginx reverse proxy on a sub-url (e.g. https://server/frigate) of an nginx instance I’m already using for other things, however I can’t get it to work. I just end up getting an empty page.

Home assistant has direct access to the frigate container on port 5000 and I don’t intend on changing that, I just want to add a way for a web browser to access frigate using ssl+auth. Ideally I’d really like to set it up at https://server/frigate instead of having nginx listen on another port and putting it at the root (e.g. https://server:10000/).

I’ve been looking through all the documentation, but I can’t find any reference to trying to do this.

Version

0.10.0-DB1255A

Frigate config file

database:
  path: /db/frigate.db

mqtt:
  host: mosquitto-hostname
  user: mosquitto-user
  password: mosquitto-password

birdseye:
  mode: continuous

ffmpeg:
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -codec:a aac

objects:
  track:
    - person
    - cat

record:
  enabled: true
  retain:
    days: 30
  events:
    max_seconds: 1800
    pre_capture: 15
    post_capture: 15
    retain:
      default: 30

snapshots:
  enabled: true
  timestamp: true
  bounding_box: true
  retain:
    default: 30

cameras:
  Front Door:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp-user:rtsp-password@front-door-camera:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
        - path: rtsp://rtsp-user:rtsp-password@front-door-camera:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
    detect:
      width: 1280
      height: 720
      fps: 5
    objects:
      filters:
        person:
          mask:
            - 806,0,744,370,314,380,330,0
  Garage:
    ffmpeg:
      inputs:
        - path: rtsp://rtsp-user:rtsp-password@garage-camera:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - record
        - path: rtsp://rtsp-user:rtsp-password@garage-camera:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
    detect:
      width: 1280
      height: 720
      fps: 5
    objects:
      filters:
        person:
          mask:
            - 0,0,1280,0,1176,103,1129,311,900,201,0,529
        car:
          mask:
            - 0,0,1280,0,1176,103,1129,311,900,201,0,529
      track:
        - person
        - cat
        - car

Relevant log output

N/A

FFprobe output from your camera

Metadata:
    title           : Media Server
  Duration: N/A, start: 0.015000, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 3840x2160, 20 fps, 50 tbr, 90k tbn, 40 tbc
    Stream #0:1: Audio: aac (LC), 8000 Hz, mono, fltp

Frigate stats

{"Front Door":{"camera_fps":5.1,"capture_pid":233,"detection_fps":0.0,"pid":230,"process_fps":5.1,"skipped_fps":0.0},"Garage":{"camera_fps":5.1,"capture_pid":236,"detection_fps":0.0,"pid":232,"process_fps":5.1,"skipped_fps":0.0},"detection_fps":0.0,"detectors":{"cpu":{"detection_start":0.0,"inference_speed":38.2,"pid":224}},"service":{"storage":{"/dev/shm":{"free":1070.0,"mount_type":"tmpfs","total":1073.7,"used":3.8},"/media/frigate/clips":{"free":2233567.6,"mount_type":"btrfs","total":6001156.7,"used":3757209.2},"/media/frigate/recordings":{"free":2233567.6,"mount_type":"btrfs","total":6001156.7,"used":3757209.2},"/tmp/cache":{"free":995.5,"mount_type":"tmpfs","total":1000.0,"used":4.5}},"temperatures":{},"uptime":46543,"version":"0.10.0-db1255a"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

Amcrest IP8M-T2669EW-AI

Any other information that may be helpful

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
blakeblackshearcommented, Jan 26, 2022

It supports it. You have to insert a header to tell it to rewrite paths. Example

1reaction
nbartoscommented, Jan 25, 2022

Ah yea, doing it at / actually ends up working. Trying to get it working under the same domain but /frigate is the problem. Making that work likely would require a frigate change so the embedded html will start at /frigate instead of /, although at this time it seems like frigate doesn’t support that. Or at least I can’t find anything that seems to be related in the frigate config docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NGINX Reverse Proxy | NGINX Plus - NGINX Documentation
Configure NGINX as a reverse proxy for HTTP and other protocols, with support for modifying request headers and fine-tuned buffering of responses.
Read more >
How To Configure Nginx with SSL as a Reverse Proxy for ...
This post will detail how to wrap your site with SSL using the Nginx web server as a reverse proxy for your Jenkins...
Read more >
How to setup an Nginx reverse proxy server example
Here's a quick tutorial to setup an Nginx reverse proxy server. This example uses an Apache Tomcat server but the config settings apply...
Read more >
How To Use Nginx As A Reverse Proxy With SSL (Tutorial)
Learn how to setup an Nginx reverse proxy to serve your apps securely using SSL.
Read more >
How to use Nginx as reverse proxy and secure connections ...
Using Nginx to proxy pass your site with SSL security. ... and you'll need to add it to your system to install the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found