Skip to content

Commit

Permalink
Update default.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-titan authored Dec 16, 2024
1 parent 4b14bf7 commit 588fc3a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ server {
set_real_ip_from 0.0.0.0/0; # Replace with Traefik's IP range if known
real_ip_header X-Forwarded-For;

# Redirect HTTP to HTTPS if forwarded by Traefik
if ($http_x_forwarded_proto = 'https') {
return 301 https://$host$request_uri;
}

# Location block to pass PHP scripts to FastCGI (PHP-FPM) server
location ~ \.php$ {
try_files $uri =404;
Expand All @@ -34,13 +29,17 @@ server {
set $https on;
}

if ($http_x_forwarded_proto = 'https') {
set $request_scheme https; # Override REQUEST_SCHEME
}

# Pass custom HTTPS parameters and override REQUEST_SCHEME
fastcgi_param HTTPS $https;
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto;
}

client_max_body_size 15M;
client_max_body_size 128M;
server_tokens off;

# Hide PHP headers
Expand Down

0 comments on commit 588fc3a

Please sign in to comment.