diff --git a/src/common/core/ui/confs/default-server-http/ui.conf b/src/common/core/ui/confs/default-server-http/ui.conf index 67083e72f..99336022d 100644 --- a/src/common/core/ui/confs/default-server-http/ui.conf +++ b/src/common/core/ui/confs/default-server-http/ui.conf @@ -1,4 +1,13 @@ {% if UI_HOST != "" and not has_variable(all, "USE_UI", "yes") +%} +access_by_lua_block { + local ngx_var = ngx.var + local scheme = ngx_var.scheme + local http_host = ngx_var.http_host + local request_uri = ngx_var.request_uri + if scheme == "http" and http_host ~= nil and http_host ~= "" and request_uri and request_uri ~= "" then + return ngx.redirect("https://" .. http_host .. request_uri, ngx.HTTP_MOVED_PERMANENTLY) + end +} location /setup { etag off; add_header Last-Modified ""; diff --git a/src/ui/main.py b/src/ui/main.py index c2cb44286..77054091a 100755 --- a/src/ui/main.py +++ b/src/ui/main.py @@ -576,6 +576,7 @@ def setup(): "REVERSE_PROXY_HOST": request.form["ui_host"], "REVERSE_PROXY_URL": request.form["ui_url"] or "/", "AUTO_LETS_ENCRYPT": request.form.get("auto_lets_encrypt", "no"), + "GENERATE_SELF_SIGNED_SSL": "yes" if request.form.get("auto_lets_encrypt", "no") == "no" else "no", "INTERCEPTED_ERROR_CODES": "400 404 405 413 429 500 501 502 503 504", "MAX_CLIENT_SIZE": "50m", }, diff --git a/src/ui/templates/setup.html b/src/ui/templates/setup.html index 664cbce1a..cd535277f 100644 --- a/src/ui/templates/setup.html +++ b/src/ui/templates/setup.html @@ -320,7 +320,7 @@ Your BunkerWeb UI final URL will be
http://
+ data-resume>https://