问题描述
我正在使用terraform在ec2实例上安装S3存储桶,安装Nginx并通过Web服务器显示S3存储桶的内容,我可以完成大部分工作,但是我无法在其中编辑文档根目录部分将Nginx.conf文件添加到s3存储桶安装点。
location / {
}
将以上内容替换为
location / {
root /opt/interset/data;
autoindex on;
}
使用certbot创建ssl证书后,我尝试在tmp位置sed / awk Nginx.conf文件,然后将其移动以替换/etc/Nginx
中的Nginx.conf文件,出现多个错误:>
provisioner "remote-exec" {
inline = [
"sudo cp /etc/Nginx/Nginx.conf /tmp/Nginx.conf","sed -i '/^location /.*/i root /opt/data;\nautoindex on;' /tmp/Nginx.conf","mv /tmp/Nginx.conf /etc/Nginx/Nginx.conf","sudo systemctl restart Nginx"
]
错误:
null_resource.s3fs-ssl-certs (remote-exec): sed: -e expression #1,char 13: unkNown command: `.'
null_resource.s3fs-ssl-certs (remote-exec): mv: try to overwrite ‘/etc/Nginx/Nginx.conf’,overriding mode 0644 (rw-r--r--)?
如何在Nginx.conf中编辑文档根目录以指向s3存储桶安装点?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)