Skip to content

Commit

Permalink
Merge pull request quay#184 from tparikh/PROJQUAY-181
Browse files Browse the repository at this point in the history
PROJQUAY-181: updated nginx to redirect http to https for quay.io
  • Loading branch information
josephschorr committed Jan 21, 2020
2 parents 73caea1 + 56a3bc4 commit a26033a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions conf/init/nginx_conf_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ def generate_rate_limiting_config(config):
static_dir=STATIC_DIR,
)

def generate_hosted_http_base_config(config):
"""
Generates hosted http base config from the app config
"""
config = config or {}
feature_proxy_protocol = config.get("FEATURE_PROXY_PROTOCOL", False)

write_config(
os.path.join(QUAYCONF_DIR, "nginx/hosted-http-base.conf"),
feature_proxy_protocol=feature_proxy_protocol,
)

if __name__ == "__main__":
if os.path.exists(os.path.join(QUAYCONF_DIR, "stack/config.yaml")):
Expand All @@ -131,6 +142,7 @@ def generate_rate_limiting_config(config):
else:
config = None

generate_hosted_http_base_config(config)
generate_rate_limiting_config(config)
generate_server_config(config)
generate_nginx_config(config)
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# vim: ft=nginx

server {

{% if feature_proxy_protocol %}
listen 8080 default_server proxy_protocol;
{% else %}
listen 8080 default_server;
{% endif %}

server_name _;
rewrite ^ https://$host$request_uri? permanent;
}

0 comments on commit a26033a

Please sign in to comment.