Open ap-viavi opened 6 days ago
I found a workaround by applying the authentication handler only to /index.html
or any other essential file in your website.
I have used that handler for years without any problems. Maybe post your config, so that we can have a look at it?
Here is my config. It runs inside a Ubuntu 24 based container with a popular Python REST framework serving the main app, then Grafana and InfluxDB on other ports.
hosts:
paths:
# Basic Authentication
/:
mruby.handler: |
require "htpasswd.rb"
Htpasswd.new("etc/.htpasswd", "Demo server")
proxy.reverse.url: http://127.0.0.1:8000/
/grafana:
proxy.reverse.url: http://127.0.0.1:3000/
/influx:
proxy.reverse.url: http://127.0.0.1:8086/
access-log: /dev/null
error-log: /dev/stderr
crash-handler: /bin/cat
header.unset: X-Frame-Options
proxy.timeout.io: 60000 # Some requests take long
proxy.preserve-host: ON
proxy.emit-x-forwarded-headers: ON # Report client address to inner services
proxy.emit-via-header: OFF
http2-casper: OFF
http2-idle-timeout: 99
http2-reprioritize-blocking-assets: OFF
http2-max-concurrent-requests-per-connection: 250
http2-graceful-shutdown-timeout: 0
listen:
port: 80
The app is pretty complex with a lot of JS calls to different paths under "/"
Also there is an
I am trying the Basic Authentication mruby handler and it kinda works, however it asks for authentication 3 times.
What finally renders it unusable is silently failing Javascript fetch commands with
{"message":"invalid username or password"}
without even asking for more authentication.This happens with a pure HTML5 web app accessed from Chrome.
Is there a way to persist authentication state for a connection, without having to change the Web app code (too much)?