[GH-ISSUE #4694] Unable to delete proxy host with API -- http 403 error #2984

Closed
opened 2026-02-26 07:37:29 +03:00 by kerem · 2 comments
Owner

Originally created by @mg-oerp on GitHub (Aug 5, 2025).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4694

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

Unable to delete proxy hosts with API, gives 403 errors. Everything else works as expected including UI delete with same credentials

Nginx Proxy Manager Version

2.12.6

To Reproduce
Steps to reproduce the behavior:

  1. setup API credentials
  2. call /nginx/proxy-hosts/{host-id}
  3. fail with 403 error

Expected behavior

Deleting the proxy host as directed

Screenshots

Operating System

Additional context

I've built a quick FastAPI python based setup for automation purposes. It all works fine so far except for the delete, which comes back with a 403 error each time (even when running from a swagger instance). Here's a code snippet:

def delete_proxy_host_by_id(host_id: int):
    url = f"{NPM_BASE_URL}/nginx/proxy-hosts/{host_id}"
    headers={'Content-Type':'application/json'}
    auth = (NPM_LOGIN, NPM_SECRET)
    response = requests.delete(url, headers=headers, auth=auth)
    print(response)
    if response.status_code == 204:
        logger.info(f"Proxy host with ID {host_id} deleted successfully.")
        return True
    else:
        logger.error(f"Failed to delete proxy host with ID {host_id}. Status code: {response.status_code}, Response: {response.text}")
        return False

ERROR: Failed to delete proxy host with ID 42. Status code: 403, Response: {"error":{"code":403,"message":"Permission Denied"}}

Originally created by @mg-oerp on GitHub (Aug 5, 2025). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4694 <!-- Are you in the right place? - If you are looking for support on how to get your upstream server forwarding, please consider asking the community on Reddit. - If you are writing code changes to contribute and need to ask about the internals of the software, Gitter is the best place to ask. - If you think you found a bug with NPM (not Nginx, or your upstream server or MySql) then you are in the *right place.* --> **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** <!-- A clear and concise description of what the bug is. --> Unable to delete proxy hosts with API, gives 403 errors. Everything else works as expected including UI delete with same credentials **Nginx Proxy Manager Version** <!-- What version of Nginx Proxy Manager is reported on the login page? --> 2.12.6 **To Reproduce** Steps to reproduce the behavior: 1. setup API credentials 2. call /nginx/proxy-hosts/{host-id} 3. fail with 403 error **Expected behavior** <!-- A clear and concise description of what you expected to happen. --> Deleting the proxy host as directed **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> **Operating System** <!-- Please specify if using a Rpi, Mac, orchestration tool or any other setups that might affect the reproduction of this error. --> **Additional context** <!-- Add any other context about the problem here, docker version, browser version, logs if applicable to the problem. Too much info is better than too little. --> I've built a quick FastAPI python based setup for automation purposes. It all works fine so far except for the delete, which comes back with a 403 error each time (even when running from a swagger instance). Here's a code snippet: ``` def delete_proxy_host_by_id(host_id: int): url = f"{NPM_BASE_URL}/nginx/proxy-hosts/{host_id}" headers={'Content-Type':'application/json'} auth = (NPM_LOGIN, NPM_SECRET) response = requests.delete(url, headers=headers, auth=auth) print(response) if response.status_code == 204: logger.info(f"Proxy host with ID {host_id} deleted successfully.") return True else: logger.error(f"Failed to delete proxy host with ID {host_id}. Status code: {response.status_code}, Response: {response.text}") return False ``` `ERROR: Failed to delete proxy host with ID 42. Status code: 403, Response: {"error":{"code":403,"message":"Permission Denied"}}`
kerem 2026-02-26 07:37:29 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@mg-oerp commented on GitHub (Aug 5, 2025):

In this case proxy host 42 exists and with the exact same credentials I'm able to delete in the UI.

<!-- gh-comment-id:3155565173 --> @mg-oerp commented on GitHub (Aug 5, 2025): In this case proxy host 42 exists and with the exact same credentials I'm able to delete in the UI.
Author
Owner

@mg-oerp commented on GitHub (Aug 5, 2025):

Ignore the man behind the keyboard, works when you do things properly ;)

<!-- gh-comment-id:3155620724 --> @mg-oerp commented on GitHub (Aug 5, 2025): Ignore the man behind the keyboard, works when you do things properly ;)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#2984
No description provided.