suchen
HeimBackend-EntwicklungPHP-TutorialNGINX学习笔记——传递请求头

原文地址:https://www.nginx.com/resources/admin-guide/reverse-proxy/
原文标题:Passing Request Headers


默认情况,NGINX在代理请求时会重新定义两个HTTP头字段,“Host”和“Connection”,并删除值为空的头部字段。“Host”会被设置为 $proxy_host变量的值,“Connection”被设置为close。
By default, NGINX redefines two header fields in proxied requests, “Host” and “Connection”, and eliminates the header fields whose values are empty strings. “Host” is set to the $proxy_host variable, and “Connection” is set to close.

要改变这些设置,包括修改其他头字段,使用proxy_set_header指令。这个指令可以在location或者更高层使用。也可以在特定的server上下文或者在http块中,例如:
To change these setting, as well as modify other header fields, use the proxy_set_header directive. This directive can be specified in a location or higher. It can also be specified in a particular server context or in the http block. For example:

<code>location /some/path<span>/</span> {
    proxy_set_header Host <span>$host</span>;
    proxy_set_header X<span>-Real</span><span>-IP</span><span>$remote_addr</span>;
    proxy_pass http:<span>//localhost:8000;</span>
}</code>

在这个配置中,“Host”字段被设置为$host变量。
In this configuration the “Host” field is set to the $host variable.

要阻止一个头字段被传递给被代理的服务器,只要把它设置为空字符串。
To prevent a header field from being passed to the proxied server, set it to an empty string as follows:

<code>location /some/path<span>/</span> {
    proxy_set_header Accept<span>-Encoding</span><span>""</span>;
    proxy_pass http:<span>//localhost:8000;</span>
}</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了NGINX学习笔记——传递请求头,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
windows11关机提示task host window任务宿主正在执行关闭任务的解决方法windows11关机提示task host window任务宿主正在执行关闭任务的解决方法Feb 12, 2024 pm 12:40 PM

近期不少的win11用户们反映关机的时候提示taskhostwindow任务宿主正在执行关闭任务,那么这是怎么回事?用户们可以进入到本地注册表编辑器下的Desktop文件夹,然后在右边的窗口中选择AutoEndTasks来进行设置就可以了。下面就让本站来为用户们来仔细的介绍一下关机出现这个问题的解决方法吧。windows11关机提示taskhostwindow任务宿主正在执行关闭任务的解决方法1、使用组合键win键+r键,输入“regedit”,回车,如下图所示。2、寻找[HKEY

如何检查聚合器 host.exe 在 Windows 11 中是否安全如何检查聚合器 host.exe 在 Windows 11 中是否安全Apr 13, 2023 pm 04:22 PM

当我们启动任务管理器以终止任务或停止应用程序时,我们通常会发现大量进程正在运行。这是完全正常的。但是,有时我们会看到一些程序正在使用我们完全不知道的系统资源。其中一个进程是聚合器 host.exe,它最近在用户中引起了一些混乱。其中一些进程可能是合法的 Windows 要求,但其他进程可能是在后台运行并在用户不知情或未经用户同意的情况下导致问题的恶意程序。在我们看到您可以在 Windows 11 中启动任务管理器的五种方式之后,我们将向您展示如何检查聚合器 host.exe 是安全还是病毒。跟上

Nginx Proxy Manager配置解析与优化Nginx Proxy Manager配置解析与优化Sep 26, 2023 am 09:24 AM

NginxProxyManager配置解析与优化概述:NginxProxyManager是一个基于Nginx的反向代理管理工具,可以帮助我们方便地配置和管理反向代理服务器。在使用NginxProxyManager的过程中,我们可以通过对其配置进行解析与优化,提高服务器的性能与安全性。配置解析:配置文件位置和结构:NginxProxyManag

no route to host怎么办no route to host怎么办Oct 07, 2023 am 10:50 AM

“no route to host”的解决办法有检查网络连接、检查IP地址和端口、检查防火墙配置、检查路由配置、检查网络设备配置、检查网络服务状态、检查网络配置和联系网络管理员等。详细介绍:1、检查网络连接,确保客户端和目标主机之间的网络连接正常,可以尝试通过ping命令或其他网络工具测试网络连通性,检查网线、无线网络、路由器等硬件设备是否正常工作,确保网络连接稳定等等。

master和host的区别是什么master和host的区别是什么Sep 28, 2023 pm 01:34 PM

master和host的区别有:1、host可以扮演客户端或服务器的角色,而master是分布式系统中负责协调和管理其他从服务器的中央服务器;2、host是普通的计算机设备,而master通常具有更高的处理能力和资源,用于处理和分发任务、管理数据和维护整个系统的稳定性;3、host是网络中的一个节点,而master是在分布式系统中担任核心角色的服务器。

nginx中怎么配置使用proxy protocol协议nginx中怎么配置使用proxy protocol协议May 18, 2023 am 08:47 AM

proxyprotocol在nginx中应用我们知道nginx是一个web服务器和代理服务器,它一般工作在proxyserver或者负载均衡软件(Haproxy,AmazonElasticLoadBalancer(ELB)的后面。客户端首先请求proxyserver或者LSB负载均衡软件,然后再到nginx进行真实的web访问。因为经过了多层软件,所以客户端的一些信息比如ip地址,端口号等可能就会被隐藏,这对于我们问题分析,数据统计都是不利的。因为对于nginx来说,我们希望能够获得真实的客户端

在 Windows 11 上修复 WMI Provider Host High CPU 的 4 个快速提示在 Windows 11 上修复 WMI Provider Host High CPU 的 4 个快速提示Apr 18, 2023 pm 08:25 PM

WMIProviderHost进程在Windows11中起着至关重要的作用。它使其他应用程序可以请求有关您的计算机的信息。与WMIProviderHost相关的进程通常在后台运行;因此,它们通常不会消耗大量系统资源。但是,据报道,该服务有时会因为其他应用程序而使用超过50%的CPU功率。令人担忧的是,您的计算机处理器几乎以最大容量长时间运行,因为这可能导致过热和系统组件损坏。在今天的教程中,我们将研究为什么WMIProviderHost在Windows11上的C

linux的header是什么意思linux的header是什么意思Jul 18, 2023 pm 03:34 PM

linux的header是指在文件或数据流中的开头部分,用于包含关于内容的元数据,通过正确地编写和使用Header文件,开发者能够更好地利用系统资源,提高代码的可读性和可维护性。

See all articles

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

AI Hentai Generator

AI Hentai Generator

Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

Heiße Werkzeuge

PHPStorm Mac-Version

PHPStorm Mac-Version

Das neueste (2018.2.1) professionelle, integrierte PHP-Entwicklungstool

Dreamweaver Mac

Dreamweaver Mac

Visuelle Webentwicklungstools

SecLists

SecLists

SecLists ist der ultimative Begleiter für Sicherheitstester. Dabei handelt es sich um eine Sammlung verschiedener Arten von Listen, die häufig bei Sicherheitsbewertungen verwendet werden, an einem Ort. SecLists trägt dazu bei, Sicherheitstests effizienter und produktiver zu gestalten, indem es bequem alle Listen bereitstellt, die ein Sicherheitstester benötigen könnte. Zu den Listentypen gehören Benutzernamen, Passwörter, URLs, Fuzzing-Payloads, Muster für vertrauliche Daten, Web-Shells und mehr. Der Tester kann dieses Repository einfach auf einen neuen Testcomputer übertragen und hat dann Zugriff auf alle Arten von Listen, die er benötigt.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) ist eine PHP/MySQL-Webanwendung, die sehr anfällig ist. Seine Hauptziele bestehen darin, Sicherheitsexperten dabei zu helfen, ihre Fähigkeiten und Tools in einem rechtlichen Umfeld zu testen, Webentwicklern dabei zu helfen, den Prozess der Sicherung von Webanwendungen besser zu verstehen, und Lehrern/Schülern dabei zu helfen, in einer Unterrichtsumgebung Webanwendungen zu lehren/lernen Sicherheit. Das Ziel von DVWA besteht darin, einige der häufigsten Web-Schwachstellen über eine einfache und unkomplizierte Benutzeroberfläche mit unterschiedlichen Schwierigkeitsgraden zu üben. Bitte beachten Sie, dass diese Software

MinGW – Minimalistisches GNU für Windows

MinGW – Minimalistisches GNU für Windows

Dieses Projekt wird derzeit auf osdn.net/projects/mingw migriert. Sie können uns dort weiterhin folgen. MinGW: Eine native Windows-Portierung der GNU Compiler Collection (GCC), frei verteilbare Importbibliotheken und Header-Dateien zum Erstellen nativer Windows-Anwendungen, einschließlich Erweiterungen der MSVC-Laufzeit zur Unterstützung der C99-Funktionalität. Die gesamte MinGW-Software kann auf 64-Bit-Windows-Plattformen ausgeführt werden.