Skip to content

Commit 1ca9844

Browse files
authored
Merge pull request #4 from DreamLab/add_ssl_and_base_auth_conf
reset authorization after logging and +x permissions
2 parents 72c33d8 + a0b09c7 commit 1ca9844

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ COPY files/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
1616
COPY files/ssl.conf /usr/local/openresty/nginx/conf/ssl.conf
1717

1818
ENV PORT 5000
19+
RUN chmod a+x /startup.sh /renew_token.sh
1920

2021
ENTRYPOINT ["/startup.sh"]
2122
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

files/nginx.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ http {
7373
proxy_set_header X-Forwarded-User "Basic $http_authorization";
7474
proxy_set_header Authorization "Basic $http_authorization";
7575
proxy_set_header X-Forwarded-Proto $scheme;
76+
proxy_set_header Authorization "";
7677

7778
}
7879

@@ -89,6 +90,7 @@ http {
8990
proxy_set_header X-Forwarded-User "Basic $http_authorization";
9091
proxy_set_header Authorization "Basic $http_authorization";
9192
proxy_set_header X-Forwarded-Proto $scheme;
93+
proxy_set_header Authorization "";
9294

9395
# When accessing image blobs using HTTP GET AWS ECR redirects with
9496
# s3 buckets uri to download the image. This needs to handled by
@@ -113,6 +115,7 @@ http {
113115

114116
location ~ ^/v2/.*/.*/tags/list+$ {
115117
# get paginated list of tags
118+
proxy_set_header Authorization "";
116119
content_by_lua_block {
117120
local location, tags, cjson = ngx.var.uri, {}, require "cjson"
118121
while true do
@@ -144,6 +147,7 @@ http {
144147
internal;
145148
set_unescape_uri $req_uri $arg_req_uri;
146149
proxy_pass UPSTREAM$req_uri;
150+
proxy_set_header Authorization "";
147151

148152
# Add AWS ECR authentication headers
149153
proxy_set_header X-Real-IP $remote_addr;

0 commit comments

Comments
 (0)