Skip to content

Commit 9a7fbbe

Browse files
authored
Merge pull request #156 from IABTechLab/sas-UID2-6435-logging-routes-etc
Sas UI d2 6435 logging routes etc
2 parents 3b1685d + 50422c2 commit 9a7fbbe

12 files changed

Lines changed: 19 additions & 26 deletions

File tree

tools/hashing-tool/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ server {
99
}
1010

1111
location / {
12+
access_log off;
1213
root /usr/share/nginx/html;
1314
index index.html;
1415
try_files $uri $uri/ =404;

tools/reverse-proxy/docker-entrypoint.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ DOMAIN=${DOMAIN:-sample-dev.com}
66

77
# Check if SSL certificates exist
88
if [ ! -f /etc/nginx/certs/cert.crt ] || [ ! -f /etc/nginx/certs/cert.key ]; then
9-
echo "WARNING: SSL certificates not found at /etc/nginx/certs/"
10-
echo "HTTPS will not work until you generate certificates."
11-
echo "Run 'npm install && npm run createCA' in the project root to generate certificates."
12-
echo "Then trust the CA certificate (ca/ca.crt) in your system/browser."
13-
echo ""
14-
echo "Creating self-signed fallback certificates for startup..."
9+
echo "WARNING: SSL certs missing - creating temporary self-signed fallback"
1510
# Create fallback self-signed certificate so nginx can start
1611
mkdir -p /etc/nginx/certs
1712
openssl req -x509 -nodes -days 1 -newkey rsa:2048 \

tools/reverse-proxy/nginx.conf

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
user nginx;
22
worker_processes auto;
33

4-
error_log /var/log/nginx/error.log notice;
4+
error_log /var/log/nginx/error.log warn;
55
pid /var/run/nginx.pid;
66

77
events {
@@ -12,28 +12,22 @@ http {
1212
include /etc/nginx/mime.types;
1313
default_type application/octet-stream;
1414

15-
log_format path_status '$remote_addr - $remote_user [$time_local] $request $status';
15+
# Log format for errors (4xx and 5xx) - excludes successful requests
16+
# Dimensions: IP, timestamp, method, request URL (includes query string), status, referrer
17+
log_format errors_only '$remote_addr [$time_local] $request_method "$request_uri" $status "$http_referer"';
1618

17-
# Debug log format - shows Host header details for troubleshooting routing issues
18-
# To use, switch access_log below to use debug_routing instead of path_status
19-
log_format debug_routing '$remote_addr [$time_local] "$request" '
20-
'status=$status '
21-
'host="$host" '
22-
'http_host="$http_host" '
23-
'server_name="$server_name" '
24-
'scheme=$scheme '
25-
'x_forwarded_host="$http_x_forwarded_host" '
26-
'x_forwarded_proto="$http_x_forwarded_proto"';
19+
# Map to conditionally log only 4xx and 5xx errors
20+
map $status $log_errors_only {
21+
~^[45] 1;
22+
default 0;
23+
}
2724

28-
access_log /var/log/nginx/access.log path_status;
25+
access_log /var/log/nginx/access.log errors_only if=$log_errors_only;
2926

3027
sendfile on;
31-
#tcp_nopush on;
3228

3329
keepalive_timeout 65;
3430

35-
#gzip on;
36-
3731
# Increase server_names_hash_bucket_size to handle long server names
3832
# Default is 64, but we have many long server_name entries
3933
server_names_hash_bucket_size 128;

web-integrations/google-secure-signals/client-side/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ server {
99
}
1010

1111
location / {
12+
access_log off;
1213
root /usr/share/nginx/html;
1314
index index.html;
1415
try_files $uri $uri/ =404;

web-integrations/google-secure-signals/react-client-side/server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ if (fs.existsSync(buildPath)) {
103103
app.get('*', (req, res, next) => {
104104
// Don't serve index.html for /ops/* routes
105105
if (req.path.startsWith('/ops/')) {
106-
console.log('Catch-all skipping /ops/ route:', req.path);
107106
return next();
108107
}
109108
serveIndexHtml(req, res);

web-integrations/google-secure-signals/server-side/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ app.post('/login', async (req, res) => {
266266
});
267267
}
268268
} catch (error) {
269-
console.error('Token generation failed:', error);
269+
console.error('Token generation failed:', error.message);
270270
res.render('index', {
271271
identity: null,
272272
isOptout: false,

web-integrations/javascript-sdk/client-side/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ server {
99
}
1010

1111
location / {
12+
access_log off;
1213
root /usr/share/nginx/html;
1314
index index.html;
1415
try_files $uri $uri/ =404;

web-integrations/javascript-sdk/react-client-side/server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ if (fs.existsSync(buildPath)) {
9696
app.get('*', (req, res, next) => {
9797
// Don't serve index.html for /ops/* routes
9898
if (req.path.startsWith('/ops/')) {
99-
console.log('Catch-all skipping /ops/ route:', req.path);
10099
return next();
101100
}
102101
serveIndexHtml(req, res);

web-integrations/prebid-integrations/client-side-deferred/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ server {
99
}
1010

1111
location / {
12+
access_log off;
1213
root /usr/share/nginx/html;
1314
index index.html;
1415
try_files $uri $uri/ =404;

web-integrations/prebid-integrations/client-side/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ server {
99
}
1010

1111
location / {
12+
access_log off;
1213
root /usr/share/nginx/html;
1314
index index.html;
1415
try_files $uri $uri/ =404;

0 commit comments

Comments
 (0)