mirror of
https://github.com/schnidrig/openhab-ansible
synced 2026-01-12 00:48:46 +01:00
new nginx config
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
|
||||
- name: create nginx config
|
||||
template:
|
||||
src: nginx.conf.j2
|
||||
# src: nginx.conf.j2
|
||||
src: nginx.conf.2.j2
|
||||
dest: "/etc/nginx/sites-available/openhab.conf"
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
24
roles/openhab/templates/nginx.conf.2.j2
Normal file
24
roles/openhab/templates/nginx.conf.2.j2
Normal file
@@ -0,0 +1,24 @@
|
||||
server {
|
||||
listen [::]:80 ipv6only=off;
|
||||
listen [::]:443 ipv6only=off ssl;
|
||||
server_name open-hab.dynv6.net;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/nginx.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/nginx.key;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:8080/;
|
||||
proxy_buffering off; # openHAB supports non-buffering specifically for SSEs now
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
auth_basic "Openhab";
|
||||
auth_basic_user_file /etc/nginx/htpasswd;
|
||||
}
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/html;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user