Skip to content

Conversation

@B4nan
Copy link
Member

@B4nan B4nan commented Oct 10, 2025

Alters the nginx config so it checks the Accept header, if it contains text/plain or text/markdown, we serve the markdown version directly. Also added tests for this behavior to the existing PR check.

The previews are likely using the config from master, so there it doesn't work yet (it should after we merge this).

Since the test workflow now effectively verifies the nginx config is valid, I guess we can drop the nginx.conf-test.yaml workflow.

@github-actions github-actions bot added this to the 125th sprint - Tooling team milestone Oct 10, 2025
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 10, 2025
@B4nan B4nan force-pushed the respect-accept-header branch from daf5be0 to 6c7c301 Compare October 10, 2025 11:20
@apify-service-account
Copy link

Preview for this PR was built for commit daf5be0 and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Oct 10, 2025
@B4nan B4nan force-pushed the respect-accept-header branch from 6c7c301 to 6690f27 Compare October 10, 2025 11:24
@apify-service-account
Copy link

Preview for this PR was built for commit 6c7c301 and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from 6690f27 to bc6a4e8 Compare October 10, 2025 11:28
@apify-service-account
Copy link

Preview for this PR was built for commit 6690f27e and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from bc6a4e8 to 6da05f7 Compare October 10, 2025 11:29
@apify-service-account
Copy link

Preview for this PR was built for commit bc6a4e82 and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from 6da05f7 to bae1097 Compare October 10, 2025 11:33
@apify-service-account
Copy link

Preview for this PR was built for commit 6da05f72 and is ready at https://pr-1997.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit bae10977 and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from bae1097 to e9e37bf Compare October 10, 2025 11:43
@apify-service-account
Copy link

Preview for this PR was built for commit e9e37bfd and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from e9e37bf to 6bac35b Compare October 10, 2025 11:49
@B4nan B4nan marked this pull request as ready for review October 10, 2025 11:50
@apify-service-account
Copy link

Preview for this PR was built for commit 6bac35b6 and is ready at https://pr-1997.preview.docs.apify.com!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds automatic markdown content serving based on HTTP Accept headers. When a client requests text/plain or text/markdown content types, nginx serves the markdown version of pages directly instead of the HTML version.

  • Implements nginx map directive to detect markdown-accepting clients
  • Adds location-specific handling for different URL patterns (homepage, llms.txt files, and generic docs)
  • Includes comprehensive CI tests to validate header-based content negotiation
  • Fixes a typo in localhost IP address documentation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
nginx.conf Core nginx configuration implementing Accept header detection and conditional markdown serving
.github/workflows/test.yaml Adds integration tests to verify proper Content-Type headers for various URL patterns
CONTRIBUTING.md Fixes typo in localhost IP address (127.0.01 → 127.0.0.1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@apify-service-account
Copy link

Preview for this PR was built for commit e5a4bfa9 and is ready at https://pr-1997.preview.docs.apify.com!

@jancurn
Copy link
Member

jancurn commented Oct 10, 2025

Great job guys! Pls let me know once it's deployed, will test it

@B4nan
Copy link
Member Author

B4nan commented Oct 10, 2025

One thing I just realized, this is only working for the apify-docs stuff, not for CLI, SDKs, and clients. I'd first get this out before I try to make it work there.

- name: Start Docusaurus server
run: |
nohup npx docusaurus serve --port 3000 --no-open &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@B4nan B4nan Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need apt install wait? Or how come it works for you in the other repo? :D 0e1d0e2

Error:  [Error: ENOENT: no such file or directory, lstat '/home/runner/work/apify-docs/apify-docs/wait'] {

edit: reverting for now, can't find anything about why this fails

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call with the tests, I never would've believed this without them

@apify-service-account
Copy link

Preview for this PR was built for commit 0e1d0e29 and is ready at https://pr-1997.preview.docs.apify.com!

@apify-service-account
Copy link

Preview for this PR was built for commit 24376b7a and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from 24376b7 to 7b4ff27 Compare October 10, 2025 15:49
@apify-service-account
Copy link

Preview for this PR was built for commit 7b4ff27d and is ready at https://pr-1997.preview.docs.apify.com!

@B4nan B4nan force-pushed the respect-accept-header branch from 7b4ff27 to e5a4bfa Compare October 10, 2025 15:57
@apify-service-account
Copy link

Preview for this PR was built for commit e5a4bfa9 and is ready at https://pr-1997.preview.docs.apify.com!

Copy link
Member

@lukasmrtvy lukasmrtvy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using containers (https://docs.github.com/en/actions/how-tos/write-workflows/choose-where-workflows-run/run-jobs-in-a-container) directly inside the workflow, otherwise apt might be slow and unstable.

@B4nan B4nan merged commit a712db3 into master Oct 14, 2025
18 checks passed
@B4nan B4nan deleted the respect-accept-header branch October 14, 2025 10:44
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
@B4nan B4nan mentioned this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
@B4nan B4nan mentioned this pull request Oct 14, 2025
B4nan added a commit that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants