File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ COPY files/ecr.ini /etc/supervisor.d/ecr.ini
1313COPY files/root /etc/crontabs/root
1414
1515COPY files/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
16+ COPY files/ssl.conf /usr/local/openresty/nginx/conf/ssl.conf
1617
1718ENV PORT 5000
1819
Original file line number Diff line number Diff line change @@ -18,11 +18,13 @@ http {
1818 # this is necessary for us to be able to disable request buffering in all cases
1919 proxy_http_version 1.1;
2020
21+ #SSLCONFIG
22+
2123 # will run before forking out nginx worker processes
2224 init_by_lua_block { require "cjson" }
2325
2426 server {
25- listen PORT default_server;
27+ listen LISTEN default_server;
2628
2729 # Cache
2830 add_header X-Cache-Status $upstream_cache_status ;
Original file line number Diff line number Diff line change 1+ ssl_certificate_key REGISTRY_HTTP_TLS_KEY;
2+ ssl_certificate REGISTRY_HTTP_TLS_CERTIFICATE;
3+
4+ ssl_protocols TLSv1.2;
5+ ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
6+ ssl_prefer_server_ciphers on;
7+
8+ add_header Strict-Transport-Security max-age=31536000;
9+
Original file line number Diff line number Diff line change @@ -36,11 +36,23 @@ echo Using cache max size $CACHE_MAX_SIZE
3636
3737CONFIG=/usr/local/openresty/nginx/conf/nginx.conf
3838
39+ ENABLESSL=' '
40+ SSLINCLUDE=' '
41+ SSLCONFIG=/usr/local/openresty/nginx/conf/ssl.conf
42+ if [ ! -z " $REGISTRY_HTTP_TLS_CERTIFICATE " ] && [ ! -z " $REGISTRY_HTTP_TLS_KEY " ]; then
43+ sed -i -e s! REGISTRY_HTTP_TLS_CERTIFICATE! " $REGISTRY_HTTP_TLS_CERTIFICATE " ! g $SSLCONFIG
44+ sed -i -e s! REGISTRY_HTTP_TLS_KEY! " $REGISTRY_HTTP_TLS_KEY " ! g $SSLCONFIG
45+ ENABLESSL=' ssl'
46+ SSLINCLUDE=" include $SSLCONFIG ;"
47+ fi
48+
3949# Update nginx config
4050sed -i -e s! UPSTREAM! " $UPSTREAM " ! g $CONFIG
51+ sed -i -e s! LISTEN! " $PORT $ENABLESSL " ! g $CONFIG
4152sed -i -e s! PORT! " $PORT " ! g $CONFIG
4253sed -i -e s! RESOLVER! " $RESOLVER " ! g $CONFIG
4354sed -i -e s! CACHE_MAX_SIZE! " $CACHE_MAX_SIZE " ! g $CONFIG
55+ sed -i -e s! # SSLCONFIG!"$SSLINCLUDE"!g $CONFIG
4456
4557# setup ~/.aws directory
4658AWS_FOLDER=' /root/.aws'
You can’t perform that action at this time.
0 commit comments