Can't upload PDF to S3

Finally figured it out at last. I had to add client_max_body_size in the nginx reverse proxy server for discourse. In hindsight this is obvious, but it takes time to see sometimes!