Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
ea09a931
Commit
ea09a931
authored
7 years ago
by
Arthur Ulfeldt
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #5118 from metabase/fix-5092-tls-redirect-breaks-health-check
Allow http health checks.
parents
41ca188f
6b51f308
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/aws-eb-docker/.ebextensions/01_metabase.config
+0
-1
0 additions, 1 deletion
bin/aws-eb-docker/.ebextensions/01_metabase.config
bin/aws-eb-docker/.ebextensions/metabase_config/metabase-setup.sh
+89
-2
89 additions, 2 deletions
...eb-docker/.ebextensions/metabase_config/metabase-setup.sh
with
89 additions
and
3 deletions
bin/aws-eb-docker/.ebextensions/01_metabase.config
+
0
−
1
View file @
ea09a931
...
...
@@ -22,7 +22,6 @@ container_commands:
02
_
server_https
:
command
:
".ebextensions/metabase_config/metabase-setup.sh server_https"
test
:
test
$
NGINX_FORCE_SSL
ignoreErrors
:
true
03
_
log_x_real_ip
:
...
...
This diff is collapsed.
Click to expand it.
bin/aws-eb-docker/.ebextensions/metabase_config/metabase-setup.sh
+
89
−
2
View file @
ea09a931
...
...
@@ -49,8 +49,95 @@ server_name () {
# enable https redirect
server_https
()
{
cd
/etc/nginx/sites-available/
if
[[
"
$NGINX_FORCE_SSL
"
]]
&&
!
grep
-q
https elasticbeanstalk-nginx-docker-proxy.conf
;
then
sed
-i
's|location \/ {|location \/ {\n\n if ($http_x_forwarded_proto != "https") {\n rewrite ^ https:\/\/$host$request_uri? permanent;\n }\n|'
elasticbeanstalk-nginx-docker-proxy.conf
if
[[
"x
$NGINX_FORCE_SSL
"
==
"x1"
]]
# && ! grep -q https elasticbeanstalk-nginx-docker-proxy.conf ;
then
cat
<<
'
EOF
' > elasticbeanstalk-nginx-docker-proxy.conf
map
$http_upgrade
$connection_upgrade
{
default "upgrade";
"" "";
}
server {
listen 80;
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
if (
$time_iso8601
~ "^(
\d
{4})-(
\d
{2})-(
\d
{2})T(
\d
{2})") {
set
$year
$1
;
set
$month
$2
;
set
$day
$3
;
set
$hour
$4
;
}
access_log /var/log/nginx/healthd/application.log.
$year
-
$month
-
$day
-
$hour
healthd;
access_log /var/log/nginx/access.log;
location /api/health {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection
$connection_upgrade
;
proxy_set_header Upgrade
$http_upgrade
;
proxy_set_header Host
$host
;
proxy_set_header X-Real-IP
$remote_addr
;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for
;
}
location / {
if (
$http_x_forwarded_proto
!= "https") {
rewrite ^ https://
$host$request_uri
? permanent;
}
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection
$connection_upgrade
;
proxy_set_header Upgrade
$http_upgrade
;
proxy_set_header Host
$host
;
proxy_set_header X-Real-IP
$remote_addr
;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for
;
}
}
EOF
else
cat
<<
'
EOF
' > elasticbeanstalk-nginx-docker-proxy.conf
map
$http_upgrade
$connection_upgrade
{
default "upgrade";
"" "";
}
server {
listen 80;
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
if (
$time_iso8601
~ "^(
\d
{4})-(
\d
{2})-(
\d
{2})T(
\d
{2})") {
set
$year
$1
;
set
$month
$2
;
set
$day
$3
;
set
$hour
$4
;
}
access_log /var/log/nginx/healthd/application.log.
$year
-
$month
-
$day
-
$hour
healthd;
access_log /var/log/nginx/access.log;
location / {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection
$connection_upgrade
;
proxy_set_header Upgrade
$http_upgrade
;
proxy_set_header Host
$host
;
proxy_set_header X-Real-IP
$remote_addr
;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for
;
}
}
EOF
fi
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment