-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
curpath=$PWD | ||
echo "$curpath" | ||
|
||
path=/registry | ||
path=./registry | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
worker_rlimit_nofile 51200; | ||
|
||
events { | ||
use epoll; | ||
worker_connections 51200; | ||
multi_accept on; | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$http_host $remote_user [$time_local] $request ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" $remote_addr $request_time $upstream_response_time'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
server_names_hash_bucket_size 128; | ||
client_header_buffer_size 32k; | ||
large_client_header_buffers 4 32k; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
|
||
#keepalive_timeout 0; | ||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
upstream registry_server { | ||
server registry:5000; | ||
} | ||
|
||
server { | ||
listen 443; | ||
server_name docker-hub.huawei.com; | ||
|
||
ssl on; | ||
ssl_certificate /etc/nginx/ssl/domain.crt; | ||
ssl_certificate_key /etc/nginx/ssl/domain.key; | ||
|
||
client_max_body_size 0; | ||
|
||
chunked_transfer_encoding on; | ||
|
||
location /v2/ { | ||
#auth_basic "Registry realm"; | ||
#auth_basic_user_file /opt/nginx/conf/.htpasswd; | ||
#add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always; | ||
|
||
proxy_pass https://registry_server; | ||
proxy_set_header Host $http_host; # required for docker client's sake | ||
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_read_timeout 900; | ||
} | ||
} | ||
} |