PageMotor serves the OAuth discovery documents as dynamic routes at /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server. A stock location ~ /.well-known block serves that whole path from the filesystem instead.
CloudPanel, Plesk and many hand-rolled vhosts ship one for Let's Encrypt. So the client follows PageMotor's 401 pointer into a document PageMotor never wrote, and gives up.
A PageMotor developer confirmed exactly this on CloudPanel. This is a web-server configuration fault, not a PageMotor one, so no core release fixes it and no version is immune.
Confirmed again in September 2026 on a self-managed nginx VPS running a current release, where /mcp/, /api/ and /oauth/authorize all answered correctly and only /.well-known/ returned nginx’s own 404.
Test it with curl -sI https://your-site.com/.well-known/oauth-protected-resource and read the content-type, not the status code. Exactly one answer is healthy:
# Healthy: PageMotor answered. No ETag, no Last-Modified.
HTTP/2 200
content-type: application/json
# Broken, variant 1: filesystem block, no file there.
HTTP/2 404
# Broken, variant 2: filesystem block, and a real file IS there.
HTTP/2 200
content-type: application/octet-stream
last-modified: Fri, 03 Jul 2026 20:15:09 GMT
etag: "6a48184d-7b"
accept-ranges: bytes
The 200 that lies. If a previous attempt to fix MCP involved hand-creating .well-known/oauth-protected-resource or oauth-authorization-server as files on disk, nginx finds them.
It has no MIME type for an extensionless filename, so it falls back to default_type, which is application/octet-stream.
Every MCP client rejects that content-type, so the handshake dies in the same place a 404 would have killed it, while curl -sI reports a reassuring 200.
The giveaway is the etag, last-modified and accept-ranges trio: those come from nginx serving a file off disk, and never appear on a response PHP generated.
Delete the hand-made files, apply the config below, and re-test until the content-type reads application/json. Confirmed in the wild on nginx, 2026-07-10.
First, work out which of two vhost shapes you have, because the fix differs and the wrong one silently does nothing. Do not search for proxy_pass.
A panel-rendered vhost often carries a template placeholder there instead of the literal directive. CloudPanel’s is {{varnish_proxy_pass}}, which a search for proxy_pass will still match but which tells you nothing about the port.
Count the server { blocks instead. If there is more than one, look for one that listens on a back-end port such as 8080 and holds the root, the try_files and a fastcgi_pass.
Then your PHP lives in a separate server. That is the CloudPanel shape, and you want the second block below.
If instead a single server block terminates 443 and carries root, try_files and fastcgi_pass together, PHP is right there: that is the hand-rolled and Vultr-guide shape, and you want the first block below.
Where the new blocks go, in both shapes: the server block that terminates 443 and serves your site, alongside its other location entries.
On a CloudPanel vhost that is the middle server block, the one whose server_name is your real domain, not the short first block that only issues a return 301 to redirect www, and not the back-end block on 8080.
Position within the block does not matter. You do not need to delete the stock location ~ /.well-known block: ^~ outranks a regex location, so the new blocks win while it sits there.
If your vhost appears to carry no .well-known block at all, look again. A one-line location ~ /.well-known holding only auth_basic off; and allow all; is easy to read past.
If there genuinely is none, that changes nothing: add these anyway.
The fix keeps the Let's Encrypt challenge served from disk while routing the rest of /.well-known/ to PageMotor.
Order does not matter here because ^~ is a prefix match that outranks the ~ regex block, and the longer prefix (acme-challenge) always claims its own requests:
# Keep Let's Encrypt HTTP-01 renewal working (served from disk)
location ^~ /.well-known/acme-challenge/ {
auth_basic off;
allow all;
try_files $uri =404;
}
# Hand the OAuth discovery docs (and the rest of /.well-known/) to PageMotor
location ^~ /.well-known/ {
auth_basic off;
allow all;
try_files $uri $uri/ /index.php?$args;
}
That first block is right when the PHP handler lives in the same server block, which is the hand-rolled nginx and Vultr-guide case.
Current CloudPanel is not that case. Its rendered vhost is two server blocks.
The front one, on 80/443, terminates TLS and proxies everything to a PHP backend on 127.0.0.1:8080. The backend itself holds the root, the try_files and the FastCGI handler.
The stock location ~ /.well-known block sits in the front server, where there is no PHP to hand anything to, so the try_files … /index.php fix routes nowhere there.
On CloudPanel, proxy the path to the backend instead (field-verified on a clean box, August 2026: 404 text/html before, PageMotor-generated application/json after, acme-challenge still served from disk):
# CloudPanel (two-server vhost): front server blocks
location ^~ /.well-known/acme-challenge/ {
auth_basic off;
allow all;
try_files $uri =404;
}
location ^~ /.well-known/ {
auth_basic off;
allow all;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Two verified notes on that block (clean box, August 2026; finding credit: André).
First, it proxies the whole /.well-known/ namespace deliberately rather than enumerating the discovery paths: PageMotor already publishes a third document at /.well-known/api-catalog (RFC 9727), so an enumerated fix is stale the day a fourth appears.
Proxy the namespace, not the members. Second, on this two-server stack the backend's try_files also catches the slash-less POST /mcp directly.
A Bearer-authenticated JSON-RPC initialize returned 200 with no 301. So the section 3 redirect does not arise on current CloudPanel, and no slash-tolerant /mcp block is needed there.
PageMotor's own docs cover this case too (PM_Docs, doc mcp-connection, section reverse-proxy-deployment-nginx-cloudpanel-plesk, fetchable unauthenticated via /api/). Its fix B enumerates the three discovery paths individually, which the api-catalog point above argues against.
Its fix A narrows the ACME location to ^~ /.well-known/acme-challenge/ and lets everything else fall through to the front's location / proxy.
That may make this a one-block fix on CloudPanel, but it is untested on the current two-server shape as of August 2026.
Keep auth_basic off; allow all; on the acme-challenge block.
The stock template carries both so Let's Encrypt can renew on sites gated by Basic Auth or IP restrictions; drop them and renewal on a gated site breaks silently, about 90 days later.
For any other reverse-proxied stack (Varnish, a Node or app backend), the same shape applies. Use proxy_pass to whatever your existing location / already targets, and do not assume a port.
Add proxy_set_header X-Forwarded-Proto https; if the backend does not already assert HTTPS the way CloudPanel's does.
Keep the acme-challenge block. Its position is irrelevant. The risk here is the block being absent, never it sitting below the other one.
Proxy the whole of /.well-known/ with no acme-challenge location anywhere in the vhost and Let's Encrypt's HTTP-01 challenge goes to PageMotor, which cannot answer it, so the certificate silently stops renewing until it expires around 90 days later.
Nothing appears to break on the day you make the change.
How load-bearing that block is depends on your vhost. On a single-server vhost proxying to a backend with no filesystem root, it is the only thing answering the challenge and its absence breaks renewal outright.
On CloudPanel's two-server layout the 8080 backend carries its own root plus try_files $uri $uri/ /index.php?$args, so a real challenge file is found on disk before anything reaches index.php, and blanket-proxying /.well-known/ does not orphan ACME at all.
Reported from a four-site CloudPanel fleet, August 2026, which tested both the swapped order and the block removed entirely. Keep the block regardless: it costs nothing, it documents intent, and it makes the vhost correct on either layout.
On CloudPanel make the change through the Vhost Editor so a renewal cannot revert it, then confirm two things: the discovery URL returns JSON, and your next certificate renewal succeeds.