0

我正在尝试向 nginx.conf 添加两个简单的东西,它们工作正常,直到我在 ELB 上部署一个新版本,这是预期的,所以我知道我需要使用 .ebextensions 来执行此操作,但我要么收到一条错误消息“null模板中不允许使用值”或者它不起作用。

这是我在 /.ebextensions/custom.config 中的文件

files: 
    "/etc/nginx/conf.d/000_my_config.conf": 
    content: |
        client_max_body_size 100M;
        server {
            location / {
                index index.php index.html index.htm;
                try_files $uri $uri/ /index.php?$args;
            }
        }

只需尝试更改最大上传大小并添加位置信息以使用 Wordpress

4

1 回答 1

0

存在缩进问题。它应该是(注content):

files: 
    "/etc/nginx/conf.d/000_my_config.conf": 
        content: |
            client_max_body_size 100M;
            server {
                location / {
                    index index.php index.html index.htm;
                    try_files $uri $uri/ /index.php?$args;
                }
            }

的形式files,请在此处查看

它失败的原因可能还有其他原因,从简短的问题中无法判断。但是缩进绝对是您遇到问题的原因之一。

于 2020-05-29T23:19:39.973 回答