Set real IP from local proxy

This commit is contained in:
yuri 2023-09-28 04:57:17 +02:00
parent ce5e907ed8
commit 131fc871b7
7 changed files with 23 additions and 0 deletions

View file

@ -21,6 +21,9 @@
}; };
extraConfig = '' extraConfig = ''
add_header X-Content-Type-Options nosniff; add_header X-Content-Type-Options nosniff;
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
''; '';
}; };
} }

View file

@ -78,6 +78,9 @@ in
# redirect server error pages to the static page /50x.html # redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
''; '';
}; };
} }

View file

@ -26,6 +26,9 @@
extraConfig = '' extraConfig = ''
client_max_body_size 1024m; client_max_body_size 1024m;
add_header X-Content-Type-Options nosniff; add_header X-Content-Type-Options nosniff;
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
''; '';
}; };
} }

View file

@ -28,6 +28,9 @@
client_max_body_size 1024m; client_max_body_size 1024m;
add_header X-Frame-Options DENY; add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff; add_header X-Content-Type-Options nosniff;
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
''; '';
}; };
} }

View file

@ -18,5 +18,9 @@
locations."/" = { locations."/" = {
proxyPass = "http://cloudtube.vs.grzb.de:10412"; proxyPass = "http://cloudtube.vs.grzb.de:10412";
}; };
extraConfig = ''
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
'';
}; };
} }

View file

@ -28,5 +28,9 @@
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
''; '';
}; };
extraConfig = ''
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
'';
}; };
} }

View file

@ -21,6 +21,9 @@
}; };
extraConfig = '' extraConfig = ''
client_max_body_size 80m; client_max_body_size 80m;
set_real_ip_from 127.0.0.1;
real_ip_header proxy_protocol;
''; '';
}; };
} }