截至目前,我使用此规则(在example.com的.htaccess中)将HTTPS / HTTP example.comredirect到newdomain.com: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://newdomain.com/$1 [R=301,L] 从search中,我发现以下规则将HTTPSredirect到HTTP: RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} 如何合并这些,以便 – https://example.comredirect到http://example.com ,然后http://example.comredirect到http://newdomain.com 。 我无法解释为什么我不要求这样的事情 – HTTPS /redirect到http://newdomain.com 。 总之,我已经search和问,并build议的规则不起作用,可能因为我使用自签名的证书,并为这两个域相同的证书(example.com是一个插件域,newdomain.com是主要的领域)。 请指教,如果这是有道理的。
我运行一个网站,已经在给定的位置发布了它的RSS饲料多年。 不过,我现在被迫将Feed移动到另一个url。 假设原始url为www.example.com/rss.xml ,新地址为feeds.example.com/example 。 我从谷歌网站pipe理员工具看到,有很多活动从现有的URL中获取订阅源。 我了解,HTTP传递给Feed提取器的正确方法是www.example.com/rss.xml上的HTTP头发送响应代码301 "Moved Permanently"和目标URL。 由于现有的网站限制,我现在无法做到这一点。 有没有一种方法可以告诉google读者关于redirect? 说通过谷歌网站工具或者其他方式?
由于我的疏忽,我把http://www.domain.com:8080/xxx/index.html放在网上。 我不想失去stream量,所以我想永久redirect该urlhttp://www.domain.com/xxx/index.html Nginx可以实现这一目标吗? 谢谢
我在nginx后面的apache服务器上有一个批量search表单。 我希望保护该位置,以便在10分钟内获得301的“第二个请求”,而不是像下面这样使用我们的API: http { limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; server { location = /search/bulk { limit_req zone=one burst=2; … SOME CONFIG HERE… } } } 当他们打我的limit_req,而不是显示一个ngnix错误页面时,我将如何301最终客户端? 另外,其次,我不想限制整个http子句的stream量。 我可以在没有费率的情况下设置一个limit_req_zone,但在我的位置节中有吗? 谢谢, M.
每当我在浏览器中尝试foobar.com/test时,nginx似乎都会将客户端redirect到(301)foobar.com/test/。 这种行为是不可接受的。 代理服务器是一个远程的Apache Web服务器。 我已经尝试了直接调用Apache服务器(没有代理),它不redirect客户端。 考虑到下面的nginx服务器configuration,任何想法我应该如何解决这个问题? server { listen 80; server_name fooBar.com; location /test { proxy_redirect off; proxy_pass http://1.1.1.1:80/; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_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; } location /test/ { proxy_redirect off; proxy_pass http://1.1.1.1:80/; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header […]
我想301没有任何查询string重写到网站的索引。 喜欢这个: http://example.com/anypage.asp?anyvar=anyvalue 至: http://example.com/ 这是一个真实的例子: http://atipico.com.br/conteudo.asp?P_categ=23 我试图按照这个: http : //wiki.nginx.org/NginxHttpRewriteModule#rewrite (评论是我的尝试): location ~ /conteudo\.asp(.*)$ { #rewrite ^ / permanent; #rewrite ^ /? permanent; #return 301 /; #return 301 /?; #if ($args) { return 301 /; } } 它总是重写为http://atipico.com.br/?P_categ=23 有任何想法吗?
我一直在Serverfault寻找几个小时试图解决这个问题,但我找不到解决scheme。 会发生什么是: 我有一个使用wget在我的网站302redirect循环,但不使用浏览器。 在我的nginxconfiguration中,我只有两个301redirect,而不是302 。 我试图禁用WordPress的所有插件没有运气。 什么可能导致这个问题? 下面是我的nginxconfiguration。 wget一些例子: wget elbauldelprogramador.com –2014-10-30 13:10:24– http://elbauldelprogramador.com/ Resolving elbauldelprogramador.com (elbauldelprogramador.com)… Connecting to elbauldelprogramador.com (elbauldelprogramador.com)||:80… connected. HTTP request sent, awaiting response… 302 Moved Temporarily Location: 404 [following] –2014-10-30 13:10:25– http://elbauldelprogramador.com/404 Reusing existing connection to elbauldelprogramador.com:80. HTTP request sent, awaiting response… 302 Moved Temporarily Location: 404 [following] –2014-10-30 13:10:25– http://elbauldelprogramador.com/404 […]
我正在尝试重写以我的网站为目标的url,以便将所有网域名称重写为www.example.com并具有以下configuration: mysite块 server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name _; rewrite ^ $scheme://www.example.com$request_uri permanent; location / { # Allow for large file uploads client_max_body_size 0; proxy_http_version 1.1; proxy_pass http://mysite; proxy_buffering off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } } tomcat服务器块 server { listen 80; root /opt/site2/www; […]
我有一个301redirecthttp://domain.com到http://www.domain.com ( http://www.domain.com $ S $ Q),但如果我浏览到http s :// domain.com我得到一个SSL错误(因为它期望www.domain.com)。 在浏览器抛出一个证书错误之前,有没有办法使它redirect?
我们已经注意到,当使用nginx内部301和302处理时,nginx将使用合适的Location:…头来提供一个小的文档体。 (在html中):301redirect – nginx。 根据上述行为,还会发送内容types的文本/ html和内容长度标题。 我们做了很多302和301redirect,上面的行为浪费了我们认为的带宽。 任何方式来禁用此行为? 我们的想法之一是将error_page 301 302设置为空文本文件。 我们还没有testing过,但我甚至假设上面,内容types和内容长度(0)标题将被发送。 那么,有没有一种干净的方式发送一个“无身体”301/302redirect与Nginx?