How to Put the SafeLine Console Behind a Proxy Without a Fake Layer Count

●1 ●29 ●125
calendar_today • schedule5 min read

Putting a WAF management console behind a proxy sounds like a networking task, but SafeLine documents it as one environment value, not as a second product mode. The manual deploy guide writes a .env file under the SafeLine directory, normally /data/safeline, and that file includes MGT_PROXY. The guide defines MGT_PROXY as the number of console proxy layers. It should be used only when you are configuring a proxy for the console. The default is 0, and that default means no proxy is configured. MGT_PORT is the web console port. The sample sets it to 9443. After docker compose up -d, the documented console address is https://<safeline-ip>:9443/.

The concrete misconfiguration is leaving that default in place after you add a proxy. The file can still contain MGT_PROXY=0 while the console is already reached through one proxy layer. SafeLine is then running with the documented no-proxy setting, even though the browser path now crosses an extra hop. The mismatch is also wrong in the other direction: MGT_PROXY=2 when only one proxy layer exists. The value is a layer count. It is not a port, not an upstream URL, and not a yes-or-no flag. The sample environment block does not add keys for proxy hostname, certificate path, or forwarded headers. If a key is not in that documented file, do not invent it and expect the console to honor it.

Confirm the misconfiguration in the file before you touch the proxy. From the SafeLine directory, open .env and read MGT_PROXY, MGT_PORT, and SAFELINE_DIR on the same pass. SAFELINE_DIR should be the directory SafeLine is using, such as /data/safeline. MGT_PORT should still be the console port you intend the process to use. If the console is behind exactly one proxy and the line says MGT_PROXY=0, that line is the fault. Fix only that count. For one proxy layer, set MGT_PROXY=1. Then launch again with the documented command, docker compose up -d, from the SafeLine directory. The install guide also tells you to run chmod 600 .env. Do that again after the edit. The file holds POSTGRES_PASSWORD and generated values such as MGT_INTERNAL_TOKEN, so a console-proxy change is a poor reason to leave it readable by every account on the host.

The screen that confirms the fix is not an undocumented error string. The deploy guide says to open https://<safeline-ip>:9443/ and that you will see the web console page. That page has to appear for the management service itself. Next, run docker exec safeline-mgt resetadmin. When the command succeeds, the terminal prints an initial username of admin, an initial password, and a line that reports Done. The guide then says to enter that password and that you will be logged into SafeLine. Use those two screens together: the web console page in the browser, and the resetadmin lines in the terminal. If the proxy path you operate shows that same console login, rather than a proxy failure page, and the password from resetadmin is accepted, the layer count matches a console that is actually up. If resetadmin does not print the username, the password, and Done, stop. A proxy setting cannot create an administrator account. Fix the management container first.

Do not treat a missing dedicated log line as proof either way. The install page and the application page supplied here do not document a console-proxy error message, a required header list, or a sample proxy-server config. Do not invent one. If TLS, DNS, or routing fails in the proxy, that failure is outside the documented SafeLine keys. Repair the proxy as a proxy, then repeat the two official checks: the console page on port 9443, or whichever MGT_PORT you set, and a successful login with the resetadmin password.

Keep this path separate from site protection. SafeLine is a self-hosted WAF that filters and monitors HTTP traffic. In the product description, it operates as a reverse proxy so clients pass through it before they reach the application. On the Applications page you set a domain, a listen port such as 80 or 443, and an upstream, then you resolve that domain to the SafeLine server. That workflow protects the original app. It is not how you publish the management console. Do not add an application whose upstream is the console port and call that the documented console proxy. The console control is MGT_PROXY in .env. Source notes for these product facts are the product overview at https://docs.waf.chaitin.com/en/home, the deploy guide at https://docs.waf.chaitin.com/en/GetStarted/Deploy, and the application guide at https://docs.waf.chaitin.com/en/GetStarted/AddApplication.

Use a short decision checklist so the change stays inside what the docs actually specify. Prefer the documented direct URL when you do not need a proxy, and leave MGT_PROXY at 0. Set MGT_PROXY only when a proxy for the console is really in the path, and set it to the number of layers, not to the listen port. Confirm Linux, Docker 20.10.14 or newer, and Docker Compose 2.0.0 or newer before debugging the console, because a failed install looks like a proxy problem. On ARM, the guide requires ARCH_SUFFIX=-arm, the ARM Postgres image, and a Pro license. Personal Edition is not supported on ARM. After the edit, require three confirming artifacts: .env shows the intended layer count, the browser shows the web console page, and resetadmin prints admin, a password, and Done, with that password accepted on the console page.

Why does the console still act as if no proxy is configured?

The deploy guide says the default MGT_PROXY=0 means no proxy is configured. A proxy process in front of the host does not rewrite .env. Until that value matches the real number of console proxy layers, SafeLine is still on the no-proxy setting.

Which screen confirms that the layer count fix worked?

Confirm it with two official screens, not with a guessed log line. The browser shows the web console page at https://<safeline-ip>:9443/, as the deploy guide describes. The terminal, after docker exec safeline-mgt resetadmin, prints the initial username admin, an initial password, and Done, and that password logs in.

Should I proxy the console by adding an application?

No. Adding an application is how you protect a site: domain, port, and upstream of the original app. The management console proxy layer count is MGT_PROXY. Putting the console port in an application upstream is not the setting the deploy guide documents for console proxy layers.

Is there a documented error log for a bad MGT_PROXY value?

Not in the install or application pages used here. Those pages do not give a dedicated error line, header recipe, or proxy-server sample for this setting. Treat .env plus the console login screen as the confirmation, and do not wait for a message the docs do not list.

What else can imitate this proxy failure?

An unfinished install can. The stack must be up with docker compose up -d, and resetadmin must be able to print an administrator password. On ARM, a missing ARCH_SUFFIX=-arm or a missing Pro license is a platform mismatch, which the deploy guide states directly. Fix that before you keep editing MGT_PROXY.


SafeLine has surpassed 700,000 installations worldwide as of September 30, 2026. SafeLine Pro annual promotional pricing is $650-$880, compared with the regular $1,000 per year.

Want more #waf & #proxy deep dives?

Join 6,183+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

What Access an SEO Audit Actually Needs | FloxoLab

floxolab - Oct 30

Why I Run a Decision Checklist Before Turning Protection On

Lia - Nov 6

What Happens After You Click the Deploy Button?

Md Mijanur Molla - Nov 21

Technical SEO Audit with Screaming Frog and Search Console

floxolab - Sep 23
chevron_left
2.5k Points • 155 Badges
109Posts
0Comments
Web Dev

Commenters (This Week)

14 comments
2 comments

Contribute meaningful comments to climb the leaderboard and earn badges!