Local Ip Adresses
add .local domains in your local wifi network.
Install
(for linux lubuntu)
shSize: 75 Bytes
sudo apt update
sudo apt install avahi-utils libnss-mdns avahi-daemon nginxnginx
shSize: 47 Bytes
sudo nano /etc/nginx/sites-available/local-appsnginx.conf content
nginxSize: 997 Bytes
server {
listen 80;
server_name grafana.local;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $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;
}
}
server {
listen 80;
server_name homeassistant.local;
location / {
proxy_pass http://127.0.0.1:8123;
proxy_set_header Host $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;
}
}
server {
listen 80;
server_name app.local;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $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;
}
}
Remove the nginx standard Page:
shSize: 43 Bytes
sudo rm -f /etc/nginx/sites-enabled/defaultReload
Reload the nginx server
shSize: 13 Bytes
sudo nginx -tshSize: 27 Bytes
sudo systemctl reload nginxAvahi
shSize: 38 Bytes
sudo nano /etc/avahi/avahi-daemon.confchange this line to wlo1 in the avahi daemon config
iniSize: 21 Bytes
allow-interfaces=wlo1Start
shSize: 98 Bytes
sudo systemctl enable avahi-daemon
sudo systemctl start avahi-daemon
systemctl status avahi-daemonshSize: 35 Bytes
sudo systemctl restart avahi-daemonshSize: 49 Bytes
avahi-publish -a -R grafana.local 192.168.178.103Test
shSize: 30 Bytes
avahi-resolve -n grafana.localMake Forever
shSize: 50 Bytes
sudo nano /etc/systemd/system/mdns-grafana.serviceshSize: 46 Bytes
sudo nano /etc/systemd/system/mdns-app.serviceshSize: 56 Bytes
sudo nano /etc/systemd/system/mdns-homeassistant.servicemdns-grafana.service
iniSize: 245 Bytes
[Unit]
Description=mDNS alias for Grafana
After=avahi-daemon.service
Requires=avahi-daemon.service
[Service]
ExecStart=/usr/bin/avahi-publish -a -R grafana.local 192.168.178.103
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
mdns-app.service
iniSize: 237 Bytes
[Unit]
Description=mDNS alias for app
After=avahi-daemon.service
Requires=avahi-daemon.service
[Service]
ExecStart=/usr/bin/avahi-publish -a -R app.local 192.168.178.103
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
mdns-homeassistant.service
iniSize: 257 Bytes
[Unit]
Description=mDNS alias for homeassistant
After=avahi-daemon.service
Requires=avahi-daemon.service
[Service]
ExecStart=/usr/bin/avahi-publish -a -R homeassistant.local 192.168.178.103
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
Make Active
shSize: 178 Bytes
sudo systemctl daemon-reload
sudo systemctl enable --now mdns-grafana.service
sudo systemctl enable --now mdns-app.service
sudo systemctl enable --now mdns-homeassistant.serviceTest
shSize: 69 Bytes
systemctl status mdns-grafana.service
avahi-resolve -n grafana.localPlease creadit if repost this or use it.