Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress nginx:mywebsite.intweb.net重定向您的次数太多。错误太多,重定向太多,_Wordpress_Nginx_Nginx Config - Fatal编程技术网

Wordpress nginx:mywebsite.intweb.net重定向您的次数太多。错误太多,重定向太多,

Wordpress nginx:mywebsite.intweb.net重定向您的次数太多。错误太多,重定向太多,,wordpress,nginx,nginx-config,Wordpress,Nginx,Nginx Config,当我在broswer中点击该URL时,我一直从nginx收到这个错误,但我不明白的是,我的配置中没有任何重写。此外,我没有从nginx的错误日志中获得任何相关信息。我在下面分享我的配置: # Force HTTP requests to HTTPS server { listen 80; server_name mywebsite.intweb.net; return 301 https://mywebsite.intweb.net$req

当我在broswer中点击该URL时,我一直从nginx收到这个错误,但我不明白的是,我的配置中没有任何重写。此外,我没有从nginx的错误日志中获得任何相关信息。我在下面分享我的配置:

# Force HTTP requests to HTTPS
    server {
        listen 80;
        server_name mywebsite.intweb.net;
        return 301 https://mywebsite.intweb.net$request_uri;
    }
      server {

      listen  443 ssl;
      root  /var/opt/httpd/lbdocs;

    server_name mywebsite.intweb.net ;

      # add Strict-Transport-Security to prevent man in the middle attacks
    add_header Strict-Transport-Security "max-age=31536000" always;
    ssl_certificate     /etc/pki/tls/certs/star_intweb_net.pem;
    ssl_certificate_key /etc/pki/tls/certs/star_intweb_net.key;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;

      access_log /var/log/nginx/lblogs/https/access.log;
    error_log  /var/log/nginx/lblogs/https/error.log;

   # include rewrites/mywebsite.com.conf;


    index  index.php index.html index.htm;

    # Make nginx serve static files instead of Apache
    # NOTE this will cause issues with bandwidth accounting as files wont be logged
    location ~* \.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css)$ {
        expires max;
    }

    location / {
        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_set_header Host $host;
        proxy_pass http://127.0.0.1:8080;
         }

    # proxy the PHP scripts to Apache listening on <serverIP>:8080
    location ~ \.php$ {
        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_set_header Host $host;
        proxy_pass http://127.0.0.1:8080;
         }

    location ~ /\. {
        deny  all;
    }
#强制HTTP请求使用HTTPS
服务器{
听80;
服务器名称mywebsite.intweb.net;
返回301https://mywebsite.intweb.net$request_uri;
}
服务器{
听443ssl;
root/var/opt/httpd/lbdocs;
服务器名称mywebsite.intweb.net;
添加严格的传输安全性来防止中间人攻击
始终添加_标题严格的传输安全“最大年龄=31536000”;
ssl_certificate/etc/pki/tls/certs/star_intweb_net.pem;
ssl_certificate_key/etc/pki/tls/certs/star_intweb_net.key;
ssl_协议TLSv1 TLSv1.1 TLSv1.2;
ssl_密码高:!aNULL:!MD5;
access_log/var/log/nginx/lblogs/https/access.log;
error\u log/var/log/nginx/lblogs/https/error.log;
#包括重写/mywebsite.com.conf;
index.php index.html index.htm;
#让nginx服务于静态文件而不是Apache
#注意:这将导致带宽计费问题,因为文件不会被记录
位置~*\(gif | jpg | jpeg | png | wmv | avi | mpg | mp4 | htm | html | js | css)${
最大值;
}
地点/{
代理集头X-Real-IP$remote\u addr;
proxy\u set\u header X-Forwarded-For$proxy\u add\u X\u Forwarded\u For;
代理集头X-Forwarded-Proto$方案;
代理设置头主机$Host;
代理通行证http://127.0.0.1:8080;
}
#将PHP脚本代理到Apache侦听:8080
位置~\.php${
代理集头X-Real-IP$remote\u addr;
proxy\u set\u header X-Forwarded-For$proxy\u add\u X\u Forwarded\u For;
代理集头X-Forwarded-Proto$方案;
代理设置头主机$Host;
代理通行证http://127.0.0.1:8080;
}
位置~/\{
否认一切;
}
谢谢

这可以解决我的问题:

我们反复遇到的最常见的错误配置是当用户在WordPress地址URL或站点地址URL设置中有错误的URL时

例如,假设您的网站的url为,然后转到“设置”»常规并将其设置为。大多数web主机允许您选择是要在域名中添加www前缀还是不添加www。如果您选择将www添加到url,则添加WordPress设置将导致错误。或者如果您如果您选择使用不带www前缀的域,则在WordPress设置中添加带有www前缀的域将导致此错误


如果这仍然不能解决问题,您将不得不在WP使用的数据库中进行搜索和替换。

问题与WordPress有关。我必须根据我的nginx配置指向的内容将WordPress WP-config.php文件编辑为https或常规http,否则nginx和WordPress将继续重定向到每个o然后出现此错误。

这是WordPress站点吗?是您的后端服务器吗?@IvanShatskyyes@Light.G是的,我在后端运行apache,但在我向后端发送ssl请求时没有发生这种情况,直到我将其更改为纯HTTP,您可以看到,作为一种快速解决方法,添加
remove\u操作('template_redirect'、'redirect_canonical');
位于当前主题的
functions.php
文件的开头。