-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
Reorganize and update reverse proxy documentation #2456
base: main
Are you sure you want to change the base?
Conversation
Create succinct Apache2 reverse proxy settings Placed everything "security" section.
Fixed headings so the toc looks better
✅ Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@openhab/maintainers Who feels capable of reviewing the content of this? @bens95 Thanks for providing the content so far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a link to https://ssl-config.mozilla.org as it contains up-to-date configuration files to Apache and nginx with secure ciphers.
|
||
# Apache Reverse Proxy | ||
|
||
These are the steps required to use [**Apache 2.4**](https://www.apache.org/), a HTTP server, although you can use [**NGINX**](reverse-proxy-nginx) server or any other HTTP server which supports reverse proxying. If you are familiar with Apache/basic reverse proxy config and are only interested in OpenHAB specific caveats/directives skip to [OpenHAB settings](#openhab-specific-settings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the steps required to use [**Apache 2.4**](https://www.apache.org/), a HTTP server, although you can use [**NGINX**](reverse-proxy-nginx) server or any other HTTP server which supports reverse proxying. If you are familiar with Apache/basic reverse proxy config and are only interested in OpenHAB specific caveats/directives skip to [OpenHAB settings](#openhab-specific-settings) | |
These are the steps required to use [**Apache 2.4**](https://www.apache.org/), a HTTP server, although you can use [**NGINX**](reverse-proxy-nginx) server or any other HTTP server which supports reverse proxying. If you are familiar with Apache/basic reverse proxy config and are only interested in openHAB specific caveats/directives skip to [openHAB settings](#openhab-specific-settings) |
for Ubuntu/Debian based Linux, or | ||
|
||
```shell | ||
sudo yum install httpd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dnf
replaces yum
, so maybe replace it here as well? https://www.linode.com/docs/guides/dnf-package-manager/
</VirtualHost> | ||
``` | ||
|
||
The command `apachectl configtest` can be used to verify any config you write. To enable your new website `a2ensite <config file name>`. Once enabled, you will not have to enable your website again. Configuration can be reloaded with `systemctl reload apache2`. Please make sure to reload and clear browser cookies after every change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's a guideline in this repo, but I wouldn't use more than one sentence on one line. That makes reading diffs easier.
|
||
## Authentication | ||
|
||
Authentication is recommended for additional security. There are many ways to authenticate to a proxy, but basic auth is sufficient **as long as it is over https**. Note the below documentation about [OpenHAB specific auth headers](#authentication-headers). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Authentication is recommended for additional security. There are many ways to authenticate to a proxy, but basic auth is sufficient **as long as it is over https**. Note the below documentation about [OpenHAB specific auth headers](#authentication-headers). | |
Authentication is recommended for additional security. There are many ways to authenticate to a proxy, but basic auth is sufficient **as long as it is over https**. Note the below documentation about [openHAB specific auth headers](#authentication-headers). |
|
||
### Basic Auth | ||
|
||
The below directives set the auth type to basic, set the auth name, point to our credentials file, and require a user to be authenticated before allowing them to access OpenHAB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The below directives set the auth type to basic, set the auth name, point to our credentials file, and require a user to be authenticated before allowing them to access OpenHAB | |
The below directives set the auth type to basic, set the auth name, point to our credentials file, and require a user to be authenticated before allowing them to access openHAB |
|
||
For more details, read the [apache mod_ssl docs](https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslcertificatefile) | ||
|
||
## OpenHAB Specific Settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## OpenHAB Specific Settings | |
## openHAB Specific Settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stop commenting other wrong spellings as you get the idea.
|
||
Below is a minimal configuration for a reverse proxy that listens for https requests only, uses basic auth, and proxies to 8080 (default OpenHAB http port). | ||
|
||
```xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```xml | |
```xml | |
<VirtualHost *:80> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/ | |
RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L] | |
</VirtualHost> |
That redirects http to https which is more user-friendly as some browser still use http first.
This is the beginning of my attempts to improve/modernize reverse proxy documentation. The reverse proxy docs are very verbose, and did not include information for apache configs. I split them up in this manner for two reasons:
I also question whether some of the content in these docs belongs on an OpenHAB wiki at all. While the documentation is good, it is overly detailed. Things like purchasing a domain, letsencrypt cert generation, webserver installation, etc are better documented on their own wikis/elsewhere. If I were starting from scratch, these pages would be one article with:
However I would feel bad removing all of the work that has already been done. Thoughts?