-
Notifications
You must be signed in to change notification settings - Fork 16
/
nginx.conf
59 lines (48 loc) · 1.42 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
user root;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_types text/plain text/css text/javascript
application/javascript application/json
application/xml;
index index.html index.htm;
upstream docker_reg {
server reg:5000;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443;
root /usr/share/nginx/html;
ssl on;
ssl_certificate /usr/share/certs/server.crt;
ssl_certificate_key /usr/share/certs/private.key;
chunked_transfer_encoding on;
location / {
auth_basic "Registry realm";
auth_basic_user_file /etc/nginx/.htpasswd;
root /usr/share/nginx/html;
}
location /v2/ {
auth_basic "Registry realm";
auth_basic_user_file /etc/nginx/.htpasswd;
add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always;
proxy_read_timeout 900;
proxy_pass http://docker_reg;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
}