我终于开始设置一个Nginx反向代理来处理我在我家的多个网站,因为我只有一个外部IP地址,一切正常,但是我想知道的是,如果有一种方法可以简化我的一个网站的当前configuration比我感觉需要的时间要长。 任何input,不胜感激。 server { listen 192.168.1.176:80; server_name ighfdexplorers.com; return 301 https://www.$server_name$request_uri; } server { listen 192.168.1.176:443 ssl http2; server_name ighfdexplorers.com; return 301 https://www.$server_name$request_uri; ssl_certificate /etc/nginx/ssl/ighfdexplorers/base/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/ighfdexplorers/base/privkey.pem; } server { listen 192.168.1.176:80; server_name www.ighfdexplorers.com; return 301 https://$server_name$request_uri; } server { listen 192.168.1.176:443 ssl http2; server_name www.ighfdexplorers.com; set $upstream 192.168.1.179; ssl_certificate /etc/nginx/ssl/ighfdexplorers/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/ighfdexplorers/privkey.pem; location / […]
我正在使用我的负载均衡器进行反向代理,部分configuration文件如下所示。 但是,与某些BalanceMember的连接并不稳定(如1.2.3.1 ),并且超时会使客户端收到502代理错误。 无论如何,我可以让平衡器自动重试另一个平衡成员,如1.2.3.4 ,这样即使请求时间可能更长,客户端也不会收到错误? <Proxy balancer://mybalancer> BalancerMember http://1.2.3.1/ loadfactor=1 timeout=1 BalancerMember http://1.2.3.2/ loadfactor=1 timeout=1 BalancerMember http://1.2.3.3/ loadfactor=2 timeout=1 BalancerMember http://1.2.3.4/ loadfactor=2 timeout=1 ProxySet lbmethod=bytraffic </Proxy>
我在我的httpd.conf中有一个虚拟主机,充当反向代理。 它工作正常,我能够取代文字与我想要的,但我想包括一个文件.. ServerName example.cm ServerAlias www.example.cm Options +FollowSymLinks Options +Includes RequestHeader unset Accept-Encoding RewriteEngine on RewriteRule ^example w [L] FilterDeclare CUSTOMFILTER FilterProvider CUSTOMFILTER SUBSTITUTE resp=Content-Type $* FilterProvider CUSTOMFILTER SUBSTITUTE resp=Content-Type $/html FilterDeclare Sub FilterProvider Sub SUBSTITUTE resp=Content-Type $text/html FilterDeclare SSI FilterProvider SSI INCLUDES resp=Content-Type $text/html <Location /> ProxyPass http://www.example.com/ ProxyPassReverse http://www.example.com/ AddOutputFilterByType SUBSTITUTE text/html Substitute […]
我的nginx有一个问题:它只监听nginx上的默认虚拟主机,而不监听其他使用ipv6的vhost。 这是默认的虚拟主机networkingconfiguration: server { listen 80 default_server; listen [::]:80 default_server ipv6only=off deferred; } 这是第二个虚拟主机networkingconfiguration: server { listen 80; listen [::]:80; } nginx告诉我的错误是这样的: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) 你可以帮我吗? 谢谢大家。
我有一个Nginx代理的特定需求 我在主urlnew.example.com下有一个全新的JS应用程序(+ nginx),以及一个运行在不同url上的旧应用程序old.example.com 我需要为我的新应用程序处理search引擎的预渲染(我使用prerender nginx官方脚本作为基础)。 旧的应用程序并不需要预渲染(现在它已经成为我的预渲染器) 当用户inputwww.example.com时,他碰到我需要的nginx代理 代理/admin到old.example.com/admin 将所有机器人请求代理给预渲染器 默认代理到new.example.com 为了使事情更简单,我有代表每个应用程序@地点块(但也许这是不相容的,请告诉我) location @newapp { proxy_pass http://new.example.com:8080; } location @oldapp { proxy_pass http://old.example.com:8080; } 现在,当我的新应用程序正在开发中时,我希望/adminurlredirect到我的旧应用程序。 我在网上find了一个使用try_files和maintenance.html文件的技巧 location /admin { try_files /maintenance.html @oldapp; } 现在事情也变得严重 – 我的新应用程序需要预渲染 – 我的旧应用程序不需要预渲染,并用作当需要元素的后备 – 现在我没有prerenderer应用程序(我将安装/设置prerenderer。后来)所以我使用我的旧应用程序作为bot引擎的预渲染器 location @prerenderer { try_files /maintenance.html @oldapp # will later be changes to prerenderer.io } # in […]
我有一个在nginx后面不能识别SSL的应用程序,因此我需要执行以下操作 http://example.com/f1/f2/page?next_page=http%3A//example.com/f3/new_page 必须改变 https://example.com/f1/f2/page?next_page=https%3A//example.com/f3/new_page 所以有两件事要做,改变我所能做到的scheme,并且改变我已经有所成就的url参数,但是它并不完全工作。 我发现了一个页面,做了我想做的,但它不适合我: https : //blog.imaginea.com/modifying-query-parameters-nginx-in-reverse-proxy-mode/ 我的nginxconfiguration的相关部分: server { listen 443 ssl; server_name example.com; ssl on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_certificate /path/to/bundle.crt; ssl_certificate_key /path/to/bundle.key; ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; ssl_prefer_server_ciphers on; underscores_in_headers on; rewrite_log on; location / { if ($args ~* (.*)(next_page=http%3A)(.*)) { set $args $1next_page=https%3A$3; rewrite ^(.*)$ $1; } proxy_pass http://127.0.0.1:80; proxy_redirect http:// https://; […]
我有一个使用ADFS进行SSO的.NET应用程序。 它在我的本地机器和testing环境中testing时工作,但在部署到客户端环境时失败。 客户端环境是这样的:HTTPS公共IP:443 – > NAT内部IP – >加速器:80 – >负载平衡器:80 – >反向代理服务器:80 – > APP服务器:80 反向代理将URL从app.url.com重写到app-internal.url.com 应用程序应该像这样工作: 用户将访问http://app.url.com/appname。 然后,.NET应用程序在第一次加载时将用户redirect到ADFS服务器:http://adfsurl.domain.com/adfs/ls? 成功validation后,ADFS将redirect回应用程序URL。 我的问题是,应用程序redirect到http://app.url.com/adfs/ls/ ? 而不是http://adfsurl.domain.com/adfs/ls? 有没有其他configuration我需要做出站规则?
我们有一个独特的代理设置,我们遇到了很多麻烦,试图排除故障。 问题的核心是服务器随机返回500/502/503错误,但我们的代理来自我们不能控制的服务器。 我们至less想知道代理是问题还是我们自己设置的问题。 不幸的是,这些错误都没有被捕获到我们的目的。 我们目前的设置如下: 在RackSpace上运行的LAMP堆栈,在负载平衡器后面有2个服务器,其URL为resource.example.com/thewebsite 然后外部公司使用他们自己的设置进行代理,并通过https://www.example.com/thewebsite的url将stream量传送到域名。 问题是没有提到的500个错误login我们的结尾。 我们的假设是,这是在用户发送到负载均衡器之前发生的,所以我们没有得到日志。 有什么方法可以find或捕获在负载平衡器上的错误吗? 控制代理的外部公司在这个问题上已经完全沉默,我们很难用一个好的方法来帮助解决问题。 谢谢!
我有一个安装了nginx的AWS EC2实例,我正在尝试为Web应用程序创build一个反向代理。 这是我的* .conf文件 server { listen 8080; server_name MY_EC2_INSTANCE_PUBLIC_IP; access_log /var/log/nginx/webapp.access.log; error_log /var/log/nginx/webapp.error.log; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://WEBAPP_IP_ENDPOINT/; proxy_read_timeout 90; proxy_redirect off; } } 当我导航到http:// MY_EC2_INSTANCE_PUBLIC_IP:8080我被转发到一个404页面,说这个域没有configuration。 有没有可能做这样的事情? 我期待看到这个网页的内容,但通过我的ec2实例查看它。
在我的服务器上,我想要托pipe各种基于SMTP的Docker镜像。 所以我想能够反向代理它们以便正常运行。 在我的情况下,我需要在我的服务器上有dockerized邮件解决scheme,他们将能够发送和接收邮件。 为了更清楚我想这样做: 我已经挖了互联网周围find一个提示如何做到这一点,但不是太清楚我怎么可以做到这一点与后缀。 我能想到的最接近于使用虚拟传输,但我仍然有点困惑。 你有任何想法,如果它是可能与后缀,如何做到这一点?