Skip to content

Instantly share code, notes, and snippets.

@floehopper
Last active August 29, 2017 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/79f810b84e57700574e0e2a41544b1b5 to your computer and use it in GitHub Desktop.
Save floehopper/79f810b84e57700574e0e2a41544b1b5 to your computer and use it in GitHub Desktop.

Sendfile from NFS

$ curl -s -v http://assets-origin.dev.gov.uk/media/59a57a76759b745dd1e4555e/tmp.txt
*   Trying 10.1.1.254...
* TCP_NODELAY set
* Connected to assets-origin.dev.gov.uk (10.1.1.254) port 80 (#0)
> GET /media/59a57a76759b745dd1e4555e/tmp.txt HTTP/1.1
> Host: assets-origin.dev.gov.uk
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 29 Aug 2017 14:31:14 GMT
< Content-Type: text/plain
< Content-Length: 29
< Connection: close
< Vary: Accept-Encoding
< Vary: Accept-Encoding
< Last-Modified: Tue, 29 Aug 2017 14:30:14 GMT
< Vary: Accept-Encoding
< Content-Disposition: inline; filename="tmp.txt"
< Cache-Control: max-age=86400, public
< ETag: "59a57a76-1d"
< X-Frame-Options: DENY
< Accept-Ranges: bytes
< Strict-Transport-Security: max-age=31536000
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: origin, authorization
<
Tue 29 Aug 2017 15:30:07 BST
* Closing connection 0

Proxied to S3

$ curl -s -v http://assets-origin.dev.gov.uk/media/59a57a76759b745dd1e4555e/tmp.txt?proxy_to_s3_via_nginx=1
*   Trying 10.1.1.254...
* TCP_NODELAY set
* Connected to assets-origin.dev.gov.uk (10.1.1.254) port 80 (#0)
> GET /media/59a57a76759b745dd1e4555e/tmp.txt?proxy_to_s3_via_nginx=1 HTTP/1.1
> Host: assets-origin.dev.gov.uk
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 29 Aug 2017 14:32:10 GMT
< Content-Type: text/plain
< Content-Length: 29
< Connection: close
< Vary: Accept-Encoding
< Vary: Accept-Encoding
< Content-Disposition: inline; filename="tmp.txt"
< Cache-Control: max-age=86400, public
< Last-Modified: Tue, 29 Aug 2017 14:30:14 GMT
< ETag: "59a57a76-1d"
< Accept-Ranges: bytes
< Strict-Transport-Security: max-age=31536000
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Headers: origin, authorization
<
Tue 29 Aug 2017 15:30:07 BST
* Closing connection 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment