feat: enable HTTPS admin panel on port 443 for new deployments
Add Nginx SSL panel config, enable-panel-https.sh, secure Flask cookies, and update docs for https login. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-2
@@ -52,7 +52,8 @@ _panel_path = os.environ.get("PANEL_PATH", "").strip().strip("/")
|
||||
_panel_domain = os.environ.get("PANEL_DOMAIN", "").strip()
|
||||
if _panel_path:
|
||||
app.config["SESSION_COOKIE_PATH"] = f"/{_panel_path}/"
|
||||
app.config["PREFERRED_URL_SCHEME"] = "http"
|
||||
app.config["PREFERRED_URL_SCHEME"] = "https"
|
||||
app.config["SESSION_COOKIE_SECURE"] = True
|
||||
app.wsgi_app = ProxyFix(
|
||||
app.wsgi_app, x_for=1, x_proto=1, x_host=0, x_prefix=0
|
||||
)
|
||||
@@ -71,7 +72,7 @@ class _PanelPrefixMiddleware:
|
||||
if self.domain and not environ.get("HTTP_HOST"):
|
||||
environ["HTTP_HOST"] = self.domain
|
||||
if not environ.get("HTTP_X_FORWARDED_PROTO"):
|
||||
environ["HTTP_X_FORWARDED_PROTO"] = "http"
|
||||
environ["HTTP_X_FORWARDED_PROTO"] = "https"
|
||||
return self.app(environ, start_response)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user