add Strict-Transport-Security header even when https is configured at the load balancer

Refer #417
This commit is contained in:
Sameer Naik 2015-12-13 12:31:04 +05:30
parent b07697f6ff
commit cd8f3c1aa4
2 changed files with 3 additions and 0 deletions

View File

@ -60,6 +60,7 @@ server {
## See app/controllers/application_controller.rb for headers set
add_header X-Accel-Buffering {{NGINX_ACCEL_BUFFERING}};
add_header Strict-Transport-Security "max-age={{NGINX_HSTS_MAXAGE}};";
## Individual nginx logs for this GitLab vhost
access_log {{GITLAB_LOG_DIR}}/nginx/gitlab_access.log;

View File

@ -712,6 +712,8 @@ nginx_configure_gitlab_hsts() {
sed -i "/{{NGINX_HSTS_MAXAGE}}/d" ${GITLAB_NGINX_CONFIG}
fi
update_template ${GITLAB_NGINX_CONFIG} NGINX_HSTS_MAXAGE
else
sed -i "/{{NGINX_HSTS_MAXAGE}}/d" ${GITLAB_NGINX_CONFIG}
fi
}