chore(nginx): enhance proxy handling by adding forwarded headers mapping in Nginx configuration
This commit is contained in:
@@ -1,3 +1,18 @@
|
|||||||
|
map $http_x_forwarded_proto $forwarded_proto {
|
||||||
|
"" $scheme;
|
||||||
|
default $http_x_forwarded_proto;
|
||||||
|
}
|
||||||
|
|
||||||
|
map $http_x_forwarded_host $forwarded_host {
|
||||||
|
"" $http_host;
|
||||||
|
default $http_x_forwarded_host;
|
||||||
|
}
|
||||||
|
|
||||||
|
map $http_x_forwarded_for $forwarded_for {
|
||||||
|
"" $remote_addr;
|
||||||
|
default $http_x_forwarded_for;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
@@ -39,9 +54,10 @@ server {
|
|||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||||
fastcgi_param HTTP_X_FORWARDED_PROTO $http_x_forwarded_proto;
|
fastcgi_param HTTP_HOST $http_host;
|
||||||
fastcgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
|
fastcgi_param HTTP_X_FORWARDED_PROTO $forwarded_proto;
|
||||||
fastcgi_param HTTP_X_FORWARDED_HOST $http_x_forwarded_host;
|
fastcgi_param HTTP_X_FORWARDED_FOR $forwarded_for;
|
||||||
|
fastcgi_param HTTP_X_FORWARDED_HOST $forwarded_host;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_hide_header X-Powered-By;
|
fastcgi_hide_header X-Powered-By;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user