Skip to content

Commit

Permalink
fix(nginx): remove the x-forwarded-proto check
Browse files Browse the repository at this point in the history
that kind of check shouldn't be required, it should be optional and
based on the users environments.
  • Loading branch information
diranged committed Oct 22, 2024
1 parent d95c3ee commit 8fc7768
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions resources/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ http {
'"event_name": "NGINX_LOG"'
'}';

access_log /dev/stdout main;
map $status $loggable {
~^[23] 0;
default 1;
}
access_log /dev/stderr main if=$loggable;
error_log /dev/stderr;

upstream app {
Expand All @@ -75,22 +79,6 @@ http {
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;

if ($scheme = http) {
set $redirect_to_https true;
}

if ($http_x_forwarded_proto = "http") {
set $redirect_to_https true;
}

if ($hostname = gogo-dev) {
set $redirect_to_https false;
}

if ($redirect_to_https = true) {
rewrite ^(.*) https://$host$1;
}

# Web UI static content
location /static {
alias /app/static/;
Expand Down

0 comments on commit 8fc7768

Please sign in to comment.