Anonymous access from localhost, authentication otherwise

I am using Grafana with OpenHAB, which requires anonymous access to Grafana.
In addition, I want to have access to Grafana from internet, with SSL and authentication - though a possibility to access some selected charts anonymously would be nice.
At the moment, I have setup nginx reverse proxy to get HTTPS access to Grafana (on

OpenHAB and Grafana run on a RaspberryPi, while the nginx proxy runs on a different machine on my LAN.

Is there some, preferably simple, way of doing this?