Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A 405 Method Not Allowed response means the server recognized your HTTP method but does not permit that method for the requested resource. Start by recording the response’s Allow header, exact URI, and Server header, then determine whether Nginx generated the 405 or passed it through from your application. The repair is usually a location rule, a static fallback, proxy forwarding, or a missing WebDAV module—not a change to authentication.

Use the same method, path, headers, and body throughout testing. A successful GET does not prove that the corresponding POST, PUT, PATCH, OPTIONS, or DELETE route is configured correctly.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a 405 response means on Nginx

RFC 9110 defines 405 as a request whose method is known by the origin server but is not supported by the target resource. In a 405 response, the origin server must send an Allow header listing the methods currently supported by that resource. A method that the server does not recognize or implement is a different condition and should normally produce 501 Not Implemented.

The 405 status code indicates that the method received in the request-line is known by the origin server but not supported by the target resource.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
RFC 9110, June 2022

That distinction narrows the search. A 405 does not automatically mean that credentials are wrong, that a file is missing, or that Nginx is down. It means that the component handling this particular method and URI rejected the method. The rejecting component can be Nginx itself or the upstream application behind a reverse proxy.

Read the Allow header before changing configuration

If the response includes Allow: GET, HEAD, OPTIONS, the handler is telling you which methods it accepts at that point. Compare that list with the method your client sent. An absent or unexpected Allow header is a reason to inspect the response boundary and logs rather than immediately adding more methods.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Typical ways a 405 appears

Symptom Likely cause Where to inspect
GET succeeds but POST returns 405 The request is hitting a static handler, a method gate, or an application route that only implements GET. Location selection, try_files, limit_except, and the upstream route.
Every write method returns 405 Write methods are denied in Nginx, are not forwarded, or the endpoint is not a write-capable resource. Method restrictions, proxy directives, application logs, and the Allow header.
Only one API prefix returns 405 A more specific or regex location is overriding the intended proxy location. All matching location blocks and included snippets.
PUT, DELETE, MKCOL, COPY, or MOVE fails on a DAV path The DAV module is unavailable, the methods are not enabled, or filesystem permissions prevent the operation. Nginx build options, dav_methods, limit_except, and the target directories.
Nginx access log shows one status while the application log shows another The 405 was generated by a different layer, or Nginx changed the request before proxying it. Correlate timestamps, request IDs, method, URI, and upstream status.

Step 1: Capture the exact response and locate the boundary

First establish what was sent and which component answered. Capture response headers with a minimal client instead of relying only on a browser’s network panel.

curl -i -X POST https://example.test/api/items -H 'Content-Type: application/json' --data-binary @payload.json

Record the status line, Allow, Server, any proxy or upstream headers, the exact path, and the method. Repeat the request with the method that works so the comparison is meaningful:

curl -i https://example.test/api/items

If it is safe and authorized in your environment, send the same request directly to the upstream service on its private address. Preserve the path, headers, and body. A direct upstream success paired with a public 405 points toward Nginx’s location or proxy configuration; a direct upstream 405 means the application or its route contract is the place to fix.

Do not infer the source from the word “Nginx” alone. A reverse proxy may pass an upstream status through unchanged. Compare the Nginx access log’s request status with the upstream application log at the same timestamp. If your logging format includes an upstream status field, use it to distinguish a locally generated response from a proxied one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Step 2: Inspect the location that actually handles the URI

Nginx chooses among exact, prefix, and regular-expression locations. The block you intended to edit may not be the block that matched the request. Review the complete server block, including files loaded with include, and trace the URI through rewrites before evaluating method permissions.

Look for explicit method gates

The limit_except directive limits allowed HTTP methods inside a location. Nginx documents it for methods including GET, HEAD, POST, PUT, DELETE, OPTIONS, and PATCH. For example:

location /api/ {
    limit_except GET POST OPTIONS {
        deny all;
    }
    proxy_pass http://backend;
}

This configuration intentionally permits only GET, POST, and OPTIONS. A PUT or DELETE sent to the same location will be denied. Adapt the list to the endpoint’s actual contract; do not add every method merely to make an error disappear.

Search the selected location and its inherited or included configuration for:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • limit_except blocks that omit the method you need.
  • deny or allow rules that apply only to certain methods or networks.
  • An explicit return 405.
  • Rewrites that move the request into a different location.
  • Snippets included at server or location scope that add method restrictions.

An authentication failure normally has a 401 or 403 response, whereas a 405 says the method is not supported for that resource. Access controls can still be adjacent to the problem, so inspect them, but do not treat a credentials change as the primary fix for a method mismatch.

Check that the endpoint’s contract matches the client

Write down the intended methods for the exact resource. A collection endpoint might accept POST while an individual item accepts PUT or DELETE; an OPTIONS request may be needed for a browser’s CORS preflight; a read-only resource may correctly allow only GET and HEAD. The Allow value should agree with that design. If it does not, correct the route or its Nginx policy rather than broadening a global rule.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Step 3: Stop an API request from falling into a static fallback

A common cause is a broad single-page-application rule such as try_files $uri $uri/ /index.html;. Nginx’s try_files directive checks for files or directories and internally redirects when it finds one. If no candidate resolves, it uses the final fallback parameter or configured status. An API POST can therefore be handled by a static-content location even though the upstream API implements POST correctly.

Give the API, upload, form, or DAV path a more specific location before the broad static rule:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
location ^~ /api/ {
    proxy_pass http://backend;
}

location / {
    try_files $uri $uri/ /index.html;
}

The ^~ prefix tells Nginx to prefer this prefix over regular-expression locations once it is the best prefix match. The important design point is separation: dynamic traffic should be proxied directly, while the catch-all static location should serve only the paths intended for static content.

Symptoms of static fallback capture

  • GET for a browser page works, but POST to a similarly named API path returns 405.
  • The application log contains no record of the failing request.
  • The response body resembles an HTML error page or the single-page application shell.
  • Changing the API route to a path outside the static location makes the method work.

When these symptoms appear, inspect internal redirects and the final matched location. Do not “fix” the issue by enabling POST in the static handler; route the request to the component that owns the API contract.

Step 4: Verify reverse-proxy method, body, and header forwarding

proxy_pass determines where Nginx forwards the request. The related proxy_method, proxy_pass_request_body, and proxy_pass_request_headers directives can change what the upstream receives.

Confirm the upstream target

Check that the selected location’s proxy_pass points to the intended service and that URI rewriting is producing the path the application expects. A request can reach a healthy upstream but still return 405 if the proxy sends it to a read-only route or a different virtual host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Check for a method override

A configured proxy_method can replace the client’s method before forwarding. Unless an application specifically requires an override, remove it or ensure it preserves the endpoint’s contract. Compare the method recorded by the upstream access log with the method sent by the client.

Preserve the request body and headers when required

For POST, PUT, and PATCH, verify that request bodies are passed. For authentication, content negotiation, signatures, and CORS handling, verify that required request headers are passed as well. The defaults are often suitable, but an inherited or included directive may deliberately disable body or header forwarding. A missing body more commonly produces a validation error than 405, but it can route the request differently in an application and must be checked when diagnosing a method failure.

Use a request that is reproducible and compare three observations: the public Nginx access log, the upstream access log, and the application’s route log. This identifies whether the method changed, whether the URI changed, and whether the body arrived.

Step 5: Configure WebDAV deliberately

WebDAV is different from ordinary static serving. The Nginx ngx_http_dav_module processes PUT, DELETE, MKCOL, COPY, and MOVE. The module is not built by default; a build must include --with-http_dav_module. A package may provide it as a compiled module or omit it, so check the installed build rather than assuming it exists.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
nginx -V

Look in the build arguments for the DAV module and consult your distribution’s packaging documentation if the output is ambiguous. If the module is unavailable, enabling a directive from the DAV reference will not make WebDAV work; install a package or build that supplies the module, subject to your organization’s change controls.

Use the smallest required DAV method set

The Nginx reference pattern is:

location /dav/ {
    root /data/www;
    dav_methods PUT DELETE MKCOL COPY MOVE;
    create_full_put_path on;
    dav_access user:rw group:rw all:r;
}

These directives enable write and collection operations for that location. If you also use limit_except, make sure it does not deny the DAV methods:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
location /dav/ {
    root /data/www;
    dav_methods PUT DELETE MKCOL COPY MOVE;
    create_full_put_path on;
    dav_access user:rw group:rw all:r;

    limit_except GET HEAD PUT DELETE MKCOL COPY MOVE {
        deny all;
    }
}

Allow only the operations your client needs. Write methods expose filesystem-changing behavior, so combine them with authentication, authorization, network restrictions, safe storage paths, and logging. Check both the target file permissions and the ability to create parent directories. A module that is present but cannot write to the filesystem will produce a different failure, but permission troubleshooting should follow method and location validation rather than replace it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Step 6: Validate, reload, and replay the same request

After editing the server or location block that actually matches the request, validate the complete configuration before reloading:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
nginx -t

Use your service manager to reload Nginx after a successful test. On systems managed by systemd, the usual command is:

sudo systemctl reload nginx

Your distribution may use a different service mechanism. If the test fails, read the file and line number in the error, correct syntax or context, and run the test again. Do not reload a configuration that has not passed validation.

Replay the original request with its original method, URI, headers, and body. Then compare the new Allow header and both access logs. Testing only a GET can conceal an unchanged POST, PUT, OPTIONS, or DELETE failure.

Method-specific repair patterns

POST fails while GET works

  1. Capture both responses and compare Allow.
  2. Confirm the POST URI is in the API proxy location, not a static try_files fallback.
  3. Check that no limit_except block omits POST.
  4. Verify the upstream sees POST, the expected path, and the request body.
  5. Replay POST after validation and reload.

PUT, PATCH, or DELETE fails

Confirm that the application exposes the method for that specific resource, then inspect method gates and any proxy method override. For PUT and DELETE on a DAV path, verify the DAV module and dav_methods. For an ordinary API, proxy the request to the application instead of adding DAV directives.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OPTIONS fails

Determine whether the client is sending an OPTIONS request as a CORS preflight or as an application operation. The selected location must intentionally handle OPTIONS, and any method restriction must include it when the endpoint requires preflight. Do not enable OPTIONS globally without checking the security and CORS policy for the service.

How to choose between possible fixes

Decision factor Fix focused on Nginx Fix focused on the application
Who generated 405? Use response headers, access logs, and location inspection when Nginx generated it. Change the route or method contract when the upstream generated it.
Required methods Permit only the endpoint’s documented set in limit_except. Implement or expose the missing method on the exact resource.
Location behavior Give APIs and DAV paths specific locations and avoid static fallback capture. Correct the route if the proxied URI is valid but the application maps it incorrectly.
Body and headers Remove unintended proxy overrides and preserve required request data. Adjust validation or middleware only after confirming the request arrived intact.
WebDAV availability Install or build Nginx with the optional DAV module and configure its methods. Use the application’s own file API when DAV is not intended.
Security exposure Keep write methods scoped to a protected location and minimum set. Enforce authorization at the application resource level as well.

Common mistakes that prolong a 405 incident

  • Changing authentication first: 405 is a method-resource mismatch; changing credentials does not make a read-only location accept POST.
  • Adding every HTTP method: broad permissions can expose write operations and hide a routing error.
  • Editing the wrong server block: the request may match another server name, port, exact location, or regex location.
  • Testing only in a browser: browsers usually exercise GET, while the failing client may use POST, PUT, PATCH, OPTIONS, or DELETE with a body.
  • Ignoring included files: a shared snippet can add limit_except, rewrites, or a return status outside the file you first inspected.
  • Assuming Nginx generated the response: an upstream 405 can look identical unless logs and headers are correlated.
  • Enabling DAV without filesystem checks: the module and methods do not grant the worker process permission to create or modify files.

A compact diagnostic checklist

  1. Record the exact method, URI, status, Allow, and Server headers.
  2. Replay the request with curl, preserving headers and body.
  3. Compare the public result with a safe direct-upstream request.
  4. Identify the exact, prefix, or regex location that matched.
  5. Inspect limit_except, deny, return 405, rewrites, and included snippets.
  6. Ensure API, upload, and DAV paths cannot fall into a broad try_files static fallback.
  7. Verify proxy_pass, URI mapping, proxy_method, body forwarding, and header forwarding.
  8. For WebDAV, verify the optional module, required dav_methods, parent-directory behavior, and filesystem permissions.
  9. Run nginx -t, reload through the service manager, and replay the same request.
  10. Confirm the fix in both Nginx and upstream logs, not merely by observing that GET still works.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.