Skip to content

Commit 5a2abd1

Browse files
added nginx.conf file with custom access_log format
1 parent 3c24e3d commit 5a2abd1

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

examples/cstg/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
FROM nginx:latest
2+
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
23
COPY ./nginx/default.conf.template /etc/nginx/templates/
34
COPY ./html /usr/share/nginx/html

examples/cstg/nginx/default.conf.template

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ server {
33
server_name localhost;
44
root /usr/share/nginx/html;
55

6-
log_format path_status '$request_uri $status $remote_addr';
7-
8-
access_log /var/log/nginx/access.log path_status;
9-
106
location / {
117
sub_filter '{{ UID_JS_SDK_URL }}' '${UID_JS_SDK_URL}';
128
sub_filter '{{ UID_JS_SDK_NAME }}' '${UID_JS_SDK_NAME}';

examples/cstg/nginx/nginx.conf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
user nginx;
2+
worker_processes auto;
3+
4+
error_log /var/log/nginx/error.log notice;
5+
pid /run/nginx.pid;
6+
7+
8+
events {
9+
worker_connections 1024;
10+
}
11+
12+
13+
http {
14+
include /etc/nginx/mime.types;
15+
default_type application/octet-stream;
16+
17+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
18+
'$status $body_bytes_sent "$http_referer" '
19+
'"$http_user_agent" "$http_x_forwarded_for"';
20+
21+
log_format path_status '$remote_addr - $remote_user [$time_local] $request $status';
22+
23+
access_log /var/log/nginx/access.log path_status;
24+
25+
sendfile on;
26+
#tcp_nopush on;
27+
28+
keepalive_timeout 65;
29+
30+
#gzip on;
31+
32+
include /etc/nginx/conf.d/*.conf;
33+
}

0 commit comments

Comments
 (0)