Terraform log_format not escaped

NGINX access logs looked like ` -  [] ""   "" "" ""` before escaping this since nginx needs the literal "$values" but bash was interpreting them.
This commit is contained in:
Adam Hill
2019-10-31 15:56:35 -05:00
committed by GitHub
parent 8e7a87dfe1
commit 5076ccc4d4

View File

@@ -126,9 +126,9 @@ cat <<EOF >/etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
default_type application/octet-stream; default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" '
'$status $body_bytes_sent "$http_referer" ' '\$status \$body_bytes_sent "\$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; '"\$http_user_agent" "\$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main; access_log /var/log/nginx/access.log main;
sendfile on; sendfile on;
#tcp_nopush on; #tcp_nopush on;
@@ -195,4 +195,4 @@ sed -i -e "s/127.0.0.1/$(curl http://169.254.169.254/latest/meta-data/public-ipv
sed -i -e "s/172.25.0.3/$(curl http://169.254.169.254/latest/meta-data/local-ipv4)/" /var/opt/jfrog/artifactory/etc/ha-node.properties sed -i -e "s/172.25.0.3/$(curl http://169.254.169.254/latest/meta-data/local-ipv4)/" /var/opt/jfrog/artifactory/etc/ha-node.properties
chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/security chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/* && chown artifactory:artifactory -R /var/opt/jfrog/artifactory/etc/security
service artifactory start service artifactory start
service nginx start service nginx start