Ghost Backup Error - 502 Bad Gateway

I am getting this error, 502 bad gateway, when trying to run the command:
ghost backup

I can get to my site just fine.

✖ Backing up site
An error occurred.
Message: 'Response code 502 (Bad Gateway)'


Debug Information:
    OS: Ubuntu, v20.04.6 LTS
    Node Version: v16.20.2
    Ghost Version: 5.39.0
    Ghost-CLI Version: 1.26.1
    Environment: production
    Command: 'ghost backup'

I am doing this in prep for an upgrade.

Ghost Doctor reports no errors

✔ Checking system Node.js version - found v16.20.2
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_hbcufan-com
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.20.2

I need help upgrading my site, but I keep getting this error message. The site is available, but I cannot run the backup command.

Debug Information:
    OS: Ubuntu, v20.04.6 LTS
    Node Version: v16.20.2
    Ghost Version: 5.39.0
    Ghost-CLI Version: 1.26.1
    Environment: production
    Command: 'ghost backup'
An error occurred.
Message: 'Response code 502 (Bad Gateway)'

Stack: HTTPError: Response code 502 (Bad Gateway)
    at EventEmitter.<anonymous> (/usr/lib/node_modules/ghost-cli/node_modules/got/source/as-stream.js:35:24)
    at EventEmitter.emit (node:events:513:28)
    at module.exports (/usr/lib/node_modules/ghost-cli/node_modules/got/source/get-response.js:22:10)
    at ClientRequest.handleResponse (/usr/lib/node_modules/ghost-cli/node_modules/got/source/request-as-event-emitter.js:155:5)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.origin.emit (/usr/lib/node_modules/ghost-cli/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:534:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
Path: /ghost/api/admin/db/

You may need to follow these directions:

HOWEVER, be warned that neither Ghost backup nor the manual route in this document actually produces a 100% backup. I did this recently, and wrote about it:

TL;DR: You will lose your comments.