New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve non-html files from nginx (X-Accel-Redirect) #6404
Conversation
Remove the "if" that checks if we are in community or commercial and always serve the files from storage (S3 on commercial). The URL generated will have an AccessKey and Expires arguments.
This change will bring a possible refactor of |
This allows us to use Content-Disposition header with the proper filename on the response (including version slug on it). Besides, on corporate, this will allow us to serve non-html files without exposing the AccessKey and/or Expires and handle this internally.
This reverts commit 3f7a9a1.
a257ce8
to
6638b43
Compare
6638b43
to
540ad7f
Compare
This looks like a good approach to me. It requires some nginx changes on .org & .com, but it will make our UX around project downloads the same across both properties, which is really nice. It will let us serve the files directly from:
- https://readthedocs.org/projects/time-test/downloads/epub/latest/
- https://readthedocs.com/projects/read-the-docs-time-test/downloads/epub/latest/
And they will have the proper time-test-latest.epub
filename, which feels
…humitos/commercial-serve-non-html-storage
This looks good to me. We need to make sure that .com is ready for it when it gets deployed, but
Co-Authored-By: David Fischer <david@readthedocs.org>
Remove the "if" that checks if we are in community or commercial and always serve the files from storage (S3 on commercial). The URL generated will have an AccessKey and Expires arguments.
EDIT: this PR also returns a response with
X-Accel-Redirect
to serve the file from NGINX instead of redirecting the user to the container in BlobStorage (community). This allows us to use theContent-Disposition
header and return the filename with the version slug on it.Related to #6326 --we can probably merge both together.