Home Assistant Community Add-on: Nginx Proxy Manager

First you should remove posts with your address from above :slight_smile:

Afterwards, start with a clean state and just use NPM to point to port 8123 of HA. Making https>https reverse proxy would not really make sense.

By the way, if you select https from scheme in proxy host screen would it change anything? (since you defined port 8443 in HAā€™s configuration.yaml for secure access, port 8443 would not work anymore with http)

1 Like

Good call, thank a lot, I accidentally sent the wrong screenshotā€¦ thatā€™s Cloudflare Proxy IP but still

I just changed http to https itā€™s seem to work alright!
sorry if what Iā€™m saying make no sense, but how can I be sure that Iā€™m using NPM and not HA default server ?

when Iā€™m just entering my domain (without port, even without adding https) Iā€™m redirected to home assistant so thatā€™s good but on the home assistant companion app, I canā€™t connect anymore even if I change the port from 8433 to 433, or even without port I having ā€œError saving URL< the data couldnā€™t be read because it isnā€™t in the correct format.ā€

from NMP (itā€™s weird because Iā€™m pretty sure I was using DNS challenge)


{
  "id": 1,
  "created_on": "2021-04-03T17:21:28.000Z",
  "modified_on": "2021-04-07T13:30:48.000Z",
  "owner_user_id": 1,
  "domain_names": [
    "my.domain.com"
  ],
  "forward_host": "192.168.3.46",
  "forward_port": 8443,
  "access_list_id": 0,
  "certificate_id": 5,
  "ssl_forced": true,
  "caching_enabled": false,
  "block_exploits": true,
  "advanced_config": "",
  "meta": {
    "letsencrypt_agree": false,
    "dns_challenge": false
  },
  "allow_websocket_upgrade": true,
  "http2_support": false,
  "forward_scheme": "https",
  "enabled": 1,
  "locations": [],
  "hsts_enabled": false,
  "hsts_subdomains": false
}

EDIT : I manually imported my Cloudflare certificate which expired in 25 years anyway

Do you still have port 8443 forwarded from your router to HA?
With NPM working you would use https://your_address.org (no port, but with HTTPS) from internet.

Sole port forwarded is port 443 (to NPM). If you still use port 8443 to access HA, you need to have NPM reverse proxying port 443 to port 8443 https.

Have you enabled Force SSL in SSL tab?

Everything itā€™s fine Iā€™m only have 443 forwarding to 443, nothing else.

SSL force is enabled.
Thanks a million !

Does anyone know how to get the access/audit logs? I want to be able to see which IPā€™s have connected to my domain. I saw access.logs in the Nginx addon folder but it was empty.

Not sure if this a bug or not so Iā€™ll ask the group: but the ForceSSL option (or built-in redirect from port 80 to 443) does not seem to be working when using a custom location. Meaning:

http://home.mydomain.com auto-redirects to https://home.mydomain.com
This is good.

But when I use http://home.mydomain.com/location, it does not redirect to https://home.mydomain.com/location

Otherwise, everything else about my install seems to be working fine. Is this by design? Any way to fix it using an Advanced setting (which I know nothing about)?

Yes and yes.

Essentially each app will have its own settings to help with reverse proxying but there are some common ones. See my post no. 210 above for some examples of what goes to Advanced (for the apps that donā€™t have authentication enabled you can do that in NPM).

Is there a way to reset the login password? I canā€™t for the life of my find the password I set it as, but I can find a reset password option.

Unfortunately there is a way to reset it (as it creates security issues) from the MariaDB addon (you need to connect with Portainer to be able to run the commands).

However, maybe you only think you did but you have not actually changed the default password (changeme)

I have tried the default creds and it didnā€™t work. Thanks for the link to this. Do these commands delete the database though?

It should not delete the database but only trigger the password to reset. However, you can (and you should) do a snapshot of the addon, or even better, of the whole setup.

Sweet, already doing those daily so we are good. Thanks a bunch, Iā€™ll give this a shot later today!

Hold on though, would I even have a NPM docker-compose directory if I didnā€™t install NPM with docker? Just with the add-on.

You donā€™t need Docker-Compose commands as you already have access to the MariaDB addon through Portainer.

Ignore the line
docker exec -it nginxproxymanager_db_1 sh and just login to Portainer and ssh into MariaDB addon. Thereā€™s one difference though, due to the fact that the database is not named npm but nginxproxymanager

A complete write-up would be:

  1. Login to MariaDB addon
    mysql -u root -p
    (press enter)

USE nginxproxymanager;
UPDATE user SET is_deleted=1;
quit
exit

  1. restart NPM addon

  2. login to NPM webpage
    login: [email protected]
    pass: changeme

  3. Login to MariaDB addon
    mysql -u root -p
    (press enter)

USE nginxproxymanager;
UPDATE user SET is_deleted=0;
quit
exit

1 Like

woah okay, this is quickly going over my head, Iā€™ve never used Portainer so idk how to ssh into an addon from it. Maybe I should just uninstall/reinstall the addon and start over hah.
Can you SSH into an addon even if its not in a container?

It is not really difficult but Iā€™d suggest doing these stuff in a test environment until you get the hang of it.

I donā€™t understand this part. Are you using something other than Home Assistant OS (formerly Hassio)?

1 Like

I think I am just confused where you said ā€œjust login to Portainer and ssh into MariaDB addonā€. I now have the portainer addon intalled. But when I launch Portainer I donā€™t see where I can utilize ssh into the maria DB addon?

One of the icons for the container in Portainer will open a console into the container

1 Like

I donā€™t think its using mariadb for the DB, I do a show databases; and it doesnā€™t show up. What would it be using then?

NPM can also be configured with SQLite but the addon in Home Assistant OS is using MariaDB for a very long time.

Can you list your config and the versions run? (OS, HA, NPM, MariaDB)

LE: I see you posted earlier I try and make a new container from the MariaDB image Did you made a new MariaDB docker different from the default one used by HA?

1 Like