httpNodeAuth question


Via httpNodeAuth: it is possible to control the access to the /ui
Is there a way to access the /ui from a local address ( without the need to login while access from a remote address there is a need to give user/password?



There is no easy way to apply different authentication rules based on the source address in Node-RED.

I can think of 2 ways to approach this,

  1. use the ui: { middleware: function(req,res,next) {...}}, option in settings.js to implement an express middleware that implements authentication and only enforces it for client IP addresses outside the given range. This is too complicated to run up an example here without some trial and error and testing.

  2. Use something like nginx to proxy for Node-RED and use it to apply the the authentication restrictions. There should be some examples online about how to do this (e.g. Use nginx to Add Authentication to Any Application | Okta Developer would be a reasonable starting point)

Better nginx auth docs Restricting Access with HTTP Basic Authentication | NGINX Plus

Caddy also has a load of plugins for different authentication and authorisation schemes.

e.g. Caddy Auth Portal - Authentication Plugin for Caddy v2 implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0, SAML Authentication - (caddy-auth-portal) (

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.