Upload problem with https(or http2) and s3

I have built a site on tokyo ec2 . I also config s3 which is in tokyo for it .
I config a http2 in nginx as the article said .

And I meet a problem that is the file wound’t be uploaded when it’s size large than 500K .

If I set it http , the file will be uploaded;
If I cancel s3 config, the file also will be uploaded.

So, anyone know the problem ?

我用东京的 ec2 创建一个 app,我给它配置了 s3,http2。不过我遇到一个问题,就是当我上传图片超过500K 的时候,图片就不被上传了;小于500K的就会被上传。

如果我 把http2 改为 http,上传就可以成功;
如果我把 s3 的配置取消,上传 也可以成功。


You could try changing client_max_body_size to 10 MB or whatever size you need. Also make sure to configure the max attachment size kb site setting.

If this doesn’t solve the issue, sharing your nginx config file here may help.


Thank you for your reply.

I have solved it. When we config https for discourse, we must select force https in its setting page.

If we don’t select the option. It will fetch a ‘http://domain/**/*.js’ when we upload files which large than 500M . And baseUrl which in meta (data-discourse-setup) is also wrong .

我发现了问题。如果为discourse 配置了 https。那么我就必须在设置页里面里面的 force https 选项.