-
Notifications
You must be signed in to change notification settings - Fork 85
/
nginx.conf
72 lines (52 loc) · 1.67 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This file is copied as /etc/nginx/nginx.conf inside the container image.
user nginx;
worker_processes 1;
# Run in foreground by turning off daemon mode.
# Either set it in this file:
# daemon off;
#
# OR
#
# Pass it as an argument on command line.
# CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
# Note: The PID directory needs to exist beforehand.
# Also, the pid file is always created as/by user root.
pid /var/run/nginx.pid;
# Forward error logs to docker log collector,
# by sending it to stderr instead of a log file.
error_log /dev/stderr warn;
events {
worker_connections 32;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# Forward access logs to docker log collector,
# by sending it to stdout instead of a log file.
# This directive must be inside the nginx main 'http' section - not outside.
access_log /dev/stdout main;
sendfile on;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
server {
listen 443 ssl;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
ssl_certificate /certs/server.crt;
ssl_certificate_key /certs/server.key;
}
}