Skip to content

Commit f1b6034

Browse files
committed
try copilot advice
1 parent 15a55ef commit f1b6034

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/BenchmarksApps/TLS/Nginx/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM nginx:latest
22

3-
# Define build argument
3+
# Define the ARG variable
44
ARG SSL_LOGGING_ENABLED=false
55

6-
# Set environment variable from ARG
6+
# Set the ENV variable based on the ARG variable
77
ENV SSL_LOGGING_ENABLED=${SSL_LOGGING_ENABLED}
88

99
# Copy configuration and SSL certificates

src/BenchmarksApps/TLS/Nginx/config/nginx.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ http {
77
'"$http_user_agent" "$http_x_forwarded_for" '
88
'[$ssl_protocol] [$ssl_cipher]';
99

10-
access_log /var/log/nginx/access.log ssl_logs if=$SSL_LOGGING_ENABLED;
10+
# uncomment to get logs about TLS
11+
access_log /var/log/nginx/access.log ssl_logs {{SSL_LOGGING_ENABLED}};
1112

1213
server {
1314
listen 8080 ssl;
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/bash
2-
export SSL_LOGGING_ENABLED=${SSL_LOGGING_ENABLED}
2+
# Replace the placeholder in the nginx.conf.template with the actual value of SSL_LOGGING_ENABLED
3+
if [ "$SSL_LOGGING_ENABLED" = "true" ]; then
4+
sed 's|{{SSL_LOGGING_ENABLED}}|if=$SSL_LOGGING_ENABLED|g' /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
5+
else
6+
sed 's|{{SSL_LOGGING_ENABLED}}||g' /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
7+
fi
8+
39
echo "$(date) - Application started. Logging: $LOGGING"
410
nginx -g "daemon off;" # start nginx

0 commit comments

Comments
 (0)