Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apache2 reverse proxy documentation #4502

Merged
merged 16 commits into from
Dec 16, 2022
Merged

Add apache2 reverse proxy documentation #4502

merged 16 commits into from
Dec 16, 2022

Conversation

blacknell
Copy link
Contributor

@blacknell blacknell commented Nov 24, 2022

Closes #4496

@netlify
Copy link

netlify bot commented Nov 24, 2022

Deploy Preview for frigate-docs ready!

Name Link
🔨 Latest commit d9c6202
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/639c60fecba641000820c40d
😎 Deploy Preview https://deploy-preview-4502--frigate-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
@blacknell
Copy link
Contributor Author

@NickM-27 - I made the changes and I think I closed of the comment requests from your and requested a further review. I'm not convinced I did this right and that it might still be waiting on me rather than moved on to you.

@NickM-27
Copy link
Sponsor Collaborator

@NickM-27 - I made the changes and I think I closed of the comment requests from your and requested a further review. I'm not convinced I did this right and that it might still be waiting on me rather than moved on to you.

You did it right, I've just been busy and haven't had time to review yet

@blacknell
Copy link
Contributor Author

Can we get this merged soon 😉

docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
docs/docs/guides/reverse_proxy.md Outdated Show resolved Hide resolved
blacknell and others added 10 commits December 15, 2022 22:55
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
@blacknell
Copy link
Contributor Author

@NickM-27 - I committed the suggestions you made but in reviewing the deploy preview the whole section after step 1 is missing. I'm at a loss to figure out what happened.

@NickM-27
Copy link
Sponsor Collaborator

It looks like the ``` in the docs along with the ``` of the suggestion in github caused the commit to delete the code instead of replace it like I intended. I'll create a new suggestion to fix it

Comment on lines 56 to 74
This Apache2 configuration snippet then results in unencrypted requests being redirected to webserver SSL port
```xml
<VirtualHost *:80>
ServerName cctv.mydomain.co.uk

RewriteEngine on
RewriteCond %{SERVER_NAME} =cctv.mydomain.co.uk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
```xml
<VirtualHost *:443>
<Location />
AuthType Basic
AuthName "Restricted Files"
AuthUserFile "/var/www/passwords"
Require user paul
</Location>
</VirtualHost>
```
Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This Apache2 configuration snippet then results in unencrypted requests being redirected to webserver SSL port
```xml
<VirtualHost *:80>
ServerName cctv.mydomain.co.uk
RewriteEngine on
RewriteCond %{SERVER_NAME} =cctv.mydomain.co.uk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
```xml
<VirtualHost *:443>
<Location />
AuthType Basic
AuthName "Restricted Files"
AuthUserFile "/var/www/passwords"
Require user paul
</Location>
</VirtualHost>
```
This Apache2 configuration snippet then results in unencrypted requests being redirected to webserver SSL port
### Step 2: Use SSL to encrypt access to your Frigate instance
Whilst this won't, on its own, stop access to your Frigate webserver it will encrypt all content (such as login credentials).
Installing SSL is beyond the scope of this document but [Let's Encrypt](https://letsencrypt.org/) is a widely used approach.
This Apache2 configuration snippet then results in unencrypted requests being redirected to webserver SSL port
\`\`\`xml
<VirtualHost *:80>
ServerName cctv.mydomain.co.uk
RewriteEngine on
RewriteCond %{SERVER_NAME} =cctv.mydomain.co.uk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
\`\`\`
### Step 3: Authenticate users at the proxy
There are many ways to authenticate a website but a simple straightforward approach is to use [Apache2 password files](https://httpd.apache.org/docs/2.4/howto/auth.html).
```xml
<VirtualHost *:443>
<Location />
AuthType Basic
AuthName "Restricted Files"
AuthUserFile "/var/www/passwords"
Require user paul
</Location>
</VirtualHost>
\`\`\`

Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likely just need to copy this and remove the \ and commit on your own (not via github UI)

@blacknell
Copy link
Contributor Author

blacknell commented Dec 16, 2022

Done (thanks). And thanks for spotting the typos for which I am rather embarrassed.

@blakeblackshear blakeblackshear merged commit 499866b into blakeblackshear:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants