File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
src/BenchmarksApps/TLS/Nginx Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1
1
FROM nginx:latest
2
2
3
- # Define build argument
3
+ # Define the ARG variable
4
4
ARG SSL_LOGGING_ENABLED=false
5
5
6
- # Set environment variable from ARG
6
+ # Set the ENV variable based on the ARG variable
7
7
ENV SSL_LOGGING_ENABLED=${SSL_LOGGING_ENABLED}
8
8
9
9
# Copy configuration and SSL certificates
Original file line number Diff line number Diff line change 7
7
'"$http_user_agent" "$http_x_forwarded_for" '
8
8
'[$ssl_protocol] [$ssl_cipher]' ;
9
9
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}} ;
11
12
12
13
server {
13
14
listen 8080 ssl ;
Original file line number Diff line number Diff line change 1
1
#! /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
+
3
9
echo " $( date) - Application started. Logging: $LOGGING "
4
10
nginx -g " daemon off;" # start nginx
You can’t perform that action at this time.
0 commit comments