gpt4 book ai didi

.Net 5 AWS nginx Linux 弹性 beanstalk 改变 client_max_body_size

转载 作者:行者123 更新时间:2023-12-05 03:37:20 30 4
gpt4 key购买 nike

由于 AWS elastic beanstalk nginx 的默认设置,我无法上传超过 1 兆字节的文件。我在网上看过,发现我需要将 client_max_body_size 更改为 client_max_body_size 20M 以允许更大的文件。但是,我没有地方可以这样做。 .net 上没有 Nginx 配置文件。我正在使用 .net 5,然后在 visual studio 19 上使用 aws 工具包将其上传到 elastic beanstalk。我能看到的唯一配置文件是 aws-beanstalk-tools-defaults.json。

{
"region" : "eu-west-2",
"configuration" : "Release",
"framework" : "net5.0",
"self-contained" : false,
"application" : "testapplication",
"environment" : "testapplication-prod-env",
"enable-xray" : false,
"enhanced-health-type" : "basic",
"additional-options" : "",
"proxy-server" : "nginx",
"solution-stack" : "64bit Amazon Linux 2 v2.1.5 running .NET Core",
"environment-type" : "LoadBalanced",
"cname" : "vitradssltest-prod",
"instance-type" : "t3a.nano",
"key-pair" : "my key pair for testing",
"instance-profile" : "aws-elasticbeanstalk-ec2-role",
"service-role" : "aws-elasticbeanstalk-service-role",
"loadbalancer-type" : "classic",
"health-check-url" : "/"
}

01_nginx.config'

file location

最佳答案

因为您使用的是 运行 .NET Core 的 64 位 Amazon Linux 2 v2.1.5 nginx 默认处于打开状态。因此,我看不出任何自定义 nginx 的标准方法对您不起作用的原因。

具体来说,自定义设置应该在 .platform/nginx/conf.d/ 中,如 docs 所示。 .因此,您可以创建以下内容的 .platform/nginx/conf.d/myconfig.conf 文件:

client_max_body_size 20M;

关于.Net 5 AWS nginx Linux 弹性 beanstalk 改变 client_max_body_size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69364307/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com