Nginx reverse proxy straight to HABPanel

In good news I have successfully set up the nginx reverse proxy using the openhabian-config tool with a simple setup (no SSH, no passwords) because I only want to access it from my local area network.
I want people on the home network to be able to type “rpi.local” and go straight to "rpi.local:8080/habpanel/index.html#/ and it mostly works except it always takes me to the “Welcome to HABPanel! Click or tap here to begin” and I have to manually go into settings and switch from “Local storage” to “Panel configuration”.
Is there any way to configure the reverse proxy so that it takes me straight to the habpanel home page every time?
Most of the configuration below is default.

#################################
# openHABian NGINX Confiuration #
#################################

## Redirection
#server {
#   listen                          80;
#   server_name                     localhost;
#   return 301                      https://$server_name$request_uri;
#}

## Reverse Proxy to openHAB
server {
    listen                          80;
#   listen                          443 ssl;
    server_name                     localhost;
#   add_header                      Strict-Transport-Security "max-age=31536000; includeSubDomains";

    # Cross-Origin Resource Sharing.
    # add_header 'Access-Control-Allow-Origin' 'http://localhost:8080/rest';
    add_header 'Access-Control-Allow_Credentials' 'true';
    add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
    add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
    
## Secure Certificate Locations
#   ssl_certificate                 CERTPATH;
#   ssl_certificate_key             KEYPATH;

    location / {
       proxy_pass                              http://localhost:8080/habpanel/;
#        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;

## Password Protection
#       auth_basic                              "Username and Password Required";
#       auth_basic_user_file                    /etc/nginx/.htpasswd;
    }

 	location /rest/ {
		proxy_pass	http://localhost:8080/rest/;
	}
 	location /icon/ {
		proxy_pass	http://localhost:8080/icon/;
	}
 	location /chart/ {
		proxy_pass	http://localhost:8080/chart/;
	}
 	location /static/ {
		proxy_pass	http://localhost:8080/static/;
	}

## Let's Encrypt webroot location
#   location /.well-known/acme-challenge/ {
#       root                                    /var/www/localhost;
#   }
}

# vim: filetype=conf

Welcome to the form.
that is a nice idea and thank you for sharing it. what is the chances that you will create a tutorial of how you did the setup ? and share it with the the community .

I have actually contemplated to do it but had no idea where to start or what to do. the only difrance would be that I want to access mine from outside my local network.
and have multiple panels for different users . that will have password restrictions on them. yet again. welcome and hope you will share a lot more on the setup and when you have the last bits sorted out. sorry that I might not have been any help. but I tip my hat at you. and say well done.

:clap::clap::clap::exploding_head:

Hi - ultimately I plan to use openVPN to access from outside my local network but I want family and guests to be able to easily access home control from my local network without passwords hence I am not setting up local security. Away from home it is only me or family so VPN is the way to go … but first I need to be able to take people directly to the HABPanel UI from a simple URL.

In paperui you can configure a default panel that is used if there is no local configuration go to Configuration -> Services -> UI tab

1 Like

Thank-you. I knew it must be easy but I had no idea where to look to solve the problem. All good now.