Articles of 反向代理

如果使用特殊的头部设置,则使用proxy_pass,否则使用Nginx中的静态文件

在Nginx中有没有一种方法可以始终为root指定的静态文件提供服务,除了根据某些条件(即指定的头部)匹配请求的情况,在这种情况下,它将被传递到上游?

Nginx的proxy_path根重写到域/path

这在proxy_pass上可能是这样的吗? location / { proxy_pass http://example.com/path/; } 要求将所有来自http://example.com的请求指向http://another-example.com/path

每当我使用ProxyPass时,Apache / Windows上的HTTP 400错误请求

我无法弄清楚这一点! 一直用Googlesearch几天,尝试了一堆不同的东西。 每当我把任何代理转发,我得到HTTP错误400.这是在Windows 2012 R2在虚拟机上运行的Apache 2.4.25。 当我把相同的httpd.conf放在主机(Windows 10)上的相同的Apache上时,它工作正常。 例如,我设置了一个名为“/ goog”的代理,转发给“ http://www.google.com ”。 这很好。 在Windows 2012虚拟机上,我没有任何防病毒软件或安全软件。 在Windows 10(物理机)上,我有Bit Defender。 两台机器上的防火墙closures,IIS未安装。 我把域名放入我的本地主机文件,并ping。 我尝试使用IP地址,以及使用回送IP。 我尝试了NAT和Bridged for VM NIC。 我试着用从头开始安装的Windows 2012创build一个新的虚拟机,从头开始安装Apache。 httpd.conf中: # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for […]

IIS – 反向代理 – 在同一个盒子上的多个服务,不同的端口 – 试图使这更容易

我家有一台运行Plex的服务器作为其主要工作(媒体分发/pipe理)。 我以旅行为生,所以能够从任何地方访问我的媒体是巨大的。 因此,我还有其他的服务在Plex上运行 – 有6个,但主要是PlexPy,这个服务可以让我轻松地查看Plex服务的统计数据(什么是stream,什么,等等…)。 这些服务不是作为IIS中的网站安装的,它们只是在机器上运行的具有自己configuration端口的服务。 虽然我可以改变这些服务使用的端口,但我已经把它们中的大部分作为默认端口,这只需要我在访问它们时在networkingpath中使用它们。 这就是问题出现的地方 – 我试图让远程访问这些服务变得更容易。 在Chrome中,我在一个文件夹中有书签,但是要在其他地方访问这些东西,很难记住一些端口号。 好的,所以我决定使用反向代理服务器,而且我遇到了一些麻烦。 如果我使用(。*)正则expression式通配符在主站点上设置了一个通配符,它​​将转发给我设置的服务,但是我希望能够发送到多个不同的站点。 以下是我所做的: Main site URL Rewrite Reverse Proxy Inbound Rule: server.com:8181 (port for PlexPy) -Enable SSL Offloading (nothing should be HTTPS anyway) Default pattern is "(.*)" — if I test just going to the main site, it currently goes to PlexPy without issue […]

Nginx反向代理与GitLab作为Oauth2提供商和NextCloud

我想要做的总结如下。 我有一个NGinx服务器,承载了三种不同的东西:GitLab,NextCloud和一个专有服务。 GitLab充当Oauth供应商,用户必须通过authentication才能访问我们托pipe的任何网站。 因此,我在Nginx中使用了一个反向代理。 我成功地能够authentication并访问我们的GitLab和我们专有的软件。 但NextCloud和Oauth不想一起工作。 我还应该提到,现在我们正在混淆我们服务的url。 例如,我正在尝试在https://oursite.com/test-test/提供NextCloud,但是当您第一次访问该网站时,您应该将其redirect到GitLab,然后再跳回到NextCloud。 我还应该提到,我正在使用oauth处理程序侦听端口4180和4181的oauth2_proxy应用程序。 这里是使用的configuration: Base Nginxconfiguration server { listen 80; server_name oursite.com; client_max_body_size 10m; location /api/ { proxy_pass http://127.0.0.1:4180/api/; proxy_set_header Host $host; proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Port 443; } location /obfuscated-url-1/ { proxy_pass http://127.0.0.1:4180; proxy_set_header Host $host; proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Port 443; […]

Spring Boot Apache SSL反向代理

我有一个在Amazon Linux服务器上运行的Spring Boot应用程序。 我使用Apache HTTP服务器作为这个应用程序的代理服务器。 最近,我安装了Let's Encrypt SSL证书,并在Apache上添加了一个虚拟主机条目。 但是,我无法正确使用Spring Boot。 没有SSL版本似乎工作正常。 我观察到的是,当用户调用https版本的时候,请求来到了Spring Boot应用程序,但是用户收到来自Apache的HTTP 404错误。 例如,这工作正常: http : //example.com/oauth/token但这不起作用,并返回404: https : //example.com/oauth/token 我发布了下面的configuration文件,我错过了什么? vhosts.conf <VirtualHost *:443> ServerName example.com ServerAlias www.example.com ServerAdmin [email protected] DocumentRoot /var/www/example.com/public_html ErrorLog /var/www/example.com/logs/error.log CustomLog /var/www/example.com/logs/access.log combined RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ – [L] RewriteRule ^(/api/v1) – [L] […]

尝试用Apache代理vsphere webclient

我们希望保护我们的VMWare vsphere 6.5 Web客户端,并使用已经存在的和正在运行的Apache 2.4反向代理(有益于集中监控,mod_security et.al.) 通信客户端< – >代理和代理< – >后端(= vsphere)都必须是TLS安全的。 证书已经准备好了。 DNS相应地configuration。 客户端已经可以通过代理成功访问vsphere启动页面,例如https:// vsphere.domain.tld / Firefox的networking分析表明,所有的请求都很好,比如说 302 GET /vsphere-client/ [FQDN] document html 直到/vsphere-client/UI.swf 但是,只要用户点击链接“vSphere Web Client(Flash)”来validation并input菜单,就会引发状态码400。 “vSphere Web Client(Flash)”链接指向/ vsphere-client /,显然会调用SAML请求。 400 GET https://vsphere.domain.tld/websso/SAML2/SSO/vsphere.local?SAMLRequest=zVRba9sw[…] [FQDN] subdocument vsphere sso日志显示: tomcat-http–38 ERROR org.opensaml.common.binding.decoding.BaseSAMLMessageDecoder] SAML message intended destination endpoint 'https://vsphere-internal.domain.tld/websso/SAML2/SSO/vsphere.local' did not match the recipient endpoint […]

带有反向代理的Nginx代理

我有一台服务器上的3个服务器Minio(端口9001,9002和9003) 但是我只打开了80端口。 我试图在Minio 1 2或3redirect客户端取决于这样的url: http:// url / 1 – >redirect127.0.0.1:9001 http:// url / 2 – >redirect127.0.0.1:9002 http:// url / 3 – >redirect127.0.0.1:9003 我的问题是,Minio服务器redirect到http:// url / minio /创build一个404错误。 我真的不知道如何configuration我的nginx这些redirect。 如果你有一个想法可能会很棒 非常感谢

还有另外一个Nginx的504超时,当一个反向代理

所以我有一个nginx安装程序作为我的域的反向代理,这是从我的angularjs 2应用程序的/ api开始的调用redirect到同一台机器上的一个春季启动应用程序 但是,当我尝试执行login调用/ myname /loginPOST,调用成功进入春季启动应用程序,然后successfulyl答复,但我的前端应用程序永远不会收到一个响应,因此我得到一个504网关超时。 什么可能导致这个问题呢? 我有以下configuration: user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type […]

通过IIS反向代理与https的节点JS应用程序

你可以帮我通过IIS反向代理的HTTPS? 我在本地networking中设置我的nodejs应用程序为http://mayapp.domain.com:8080和https://myapp.domain.com:8443 。 它工作正常。 对于外部访问,我使用端口转发(8080-> 80,8443-> 443)的IIS反向代理(ARR和URL重写模块3.0)。 外部http现在工作正常,但https返回404(未find)