Skip to content

Commit dd83eaf

Browse files
B4nanclaude
andauthored
fix(nginx): add redirect for /api/v2/ trailing slash (#2224)
When accessing /api/v2/ with a trailing slash, the page returned a 404 error. This adds a redirect to remove the trailing slash, matching the behavior of other similar paths like /sdk/js/, /cli/, etc. Slack thread: https://apify.slack.com/archives/C0L33UM7Z/p1770281199186039 https://claude.ai/code/session_01GqcrG6JU9Y1YaSA5ns87Yz <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Single redirect rule change in `nginx.conf`; low blast radius and no auth/data-handling logic involved. > > **Overview** > Fixes a 404 when hitting the API reference index with a trailing slash by adding an Nginx rewrite that redirects `/api/v2/` to `/api/v2`, aligning this path with existing trailing-slash normalization for other docs entrypoints. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d6094b4. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 96bcb33 commit dd83eaf

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ server {
460460
rewrite ^/sdk/python/$ /sdk/python redirect;
461461
rewrite ^/cli/$ /cli redirect;
462462

463+
# remove trailing slashes from all other URLs (except root /)
464+
rewrite ^(.+)/$ $1 redirect;
465+
463466
# versions page redirects
464467
rewrite ^/versions/?$ / permanent; # no docs-wide changelog, redirect to the root
465468
rewrite ^/cli/versions/?$ /cli/docs/changelog permanent;

0 commit comments

Comments
 (0)