php.ini 302,302使用nginx和WordPress重定向循环
我一直在Serverfault中搜索几个小时试图解决这个问题,但我找不到解决方案.会发生什么:
我在我的网站中使用wget进行了302重定向循环,但没有使用浏览器.在我的nginx配置中,我只有两个301重定向,而不是302.我试图从wordpress禁用所有插件,没有运气.
可能导致问题的原因是什么?下面是我的nginx配置. 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
Reusing existing connection to elbauldelprogramador.com:80.
[...]
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: 404 [following]
20 redirections exceeded.
以及服务器中的日志:
S.IP - - [30/Oct/2014:13:11:22 +0100] "GET /404 HTTP/1.1" 302 154 "-" "Wget/1.15 (linux-gnu)"
S.IP - - [30/Oct/2014:13:11:22 +0100] "GET /404 HTTP/1.1" 302 154 "-" "Wget/1.15 (linux-gnu)"
S.IP - - [30/Oct/2014:13:11:22 +0100] "GET /404 HTTP/1.1" 302 154 "-" "Wget/1.15 (linux-gnu)"
Nginx配置
server {
#listen 127.0.0.1:81;
listen 80;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
# listen 127.0.0.1:81;
listen 80;
server_name example.com
port_in_redirect off;
server_tokens off;
autoindex off;
root /path;
## Page Speed Module ##
include global/pagespeed.conf;
## Fastcgi cache start ##
set $no_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $no_cache 1;
}
if ($query_string != "") {
set $no_cache 1;
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $no_cache 1;
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $no_cache 1;
}
# Deliver 404 instead of 403 "Forbidden"
error_page 403 = 404;
include global/restrictions.conf;
include global/caching.conf;
# Additional rules go here.
access_log log/access.log;
error_log log/error.log warn;
rewrite ^/sitemap_index\.xml$/index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$/index.php?sitemap=$1&sitemap_n=$2 last;
location = /p/guia-de-desarrollo-android.html {
rewrite /p/guia-de-desarrollo-android.html http://example.com/curso-programacion-android/ permanent;
}
location = /p/bases-de-datos.html {
rewrite /p/bases-de-datos.html http://example.com/bases-de-datos/ permanent;
}
location = /feeds/posts/default {
rewrite /feeds/posts/default http://example.com/feed permanent;
}
location = /p/guias-gratuitas.html {
rewrite /p/guias-gratuitas.html http://example.com/manuales-gratuitos/ permanent;
}
# Only include one of the files below.
include global/wordpress.conf;
include global/security.conf;
}
include global / wordpress.conf;
#WordPress single blog rules.
# Designed to be included in any server {} block.
#A little something from the Search Overload blog entry
location = /search {
limit_req zone=wpsearch burst=3 nodelay;
try_files $uri /index.php;
}
location / {
try_files $uri $uri/ /index.php;
}
# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)${
access_log off; log_not_found off; expires max;
}
# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php${
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
# Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked.
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
##
# Fastcgi cache
##
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
fastcgi_cache microcache;
fastcgi_cache_valid 60m;
}
提前致谢.
php.ini 302,302使用nginx和WordPress重定向循环相关推荐
- 在Ubuntu 18.04上使用Nginx安装WordPress
WordPress is one of the most popular and open source content management system (CMS) with a whopping ...
- linux搭建wordpress运行环境,Centos 6.x配置基于nginx的wordpress运行环境 | 旺旺知识库...
一.LNMP安装 Linux系统用centos 6.4,nginx 1.2.7,mysql5.1.67,php5.3.3.都是当前最新稳定版本. 1.添加YUM软件源并更新 #rpm -ivh htt ...
- nginx配置wordpress方法,wordpress nginx配置
nginx配置wordpress方法 server {listen 80;server_name wp.gsj.com;set $web_root /www/php/wp.gsj.com; locat ...
- nginx配置url重定向-反向代理
本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com IP: 192.168.10.128 apache主机,hostname: c ...
- 详解nginx配置url重定向-反向代理
本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com IP: 192.168.10.128 a ...
- nginx代理 指向_详解nginx配置url重定向-反向代理
本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com IP: 192.168.10.128 apache主机,hostname: c ...
- nginx配置url重定向_Nginx配置URL重写
URL重写是指通过配置conf文件,以让网站的URL中达到某种状态时则定向/跳转到某个规则,比如常见的伪静态.301重定向.浏览器定向等. Nginx允许使用正则表达式重写URI(需PCRE库),并且 ...
- nginx配置url重定向_nginx配置url重定向-反向代理
本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com IP: 192.168.10.128 apache主机,hostname: c ...
- nginx配置url重定向_详解nginx配置url重定向-反向代理
https://www.jb51.net/article/99996.htm 本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com ...
最新文章
- jsPlumb(3)-基本概念
- 【HDU1203 HDU2955 01背包中的简单概率问题处理】
- Logback日志系统配置攻略
- BZOJ2194 快速傅立叶之二 【fft】
- iOS之十三个小技巧帮你征服Xcode
- LR中url和html两种录制模式
- 9.MySQL数据查询SQL
- dz手机版空白显示index.php,关于Discuz x3.3页面空白解决方法
- webpack5不要再用url-loader了
- vim编辑器设置行号、缩进、tab键
- 路由与交换技术(交换机中的冗余链路管理)
- 微信小程序开发者工具简介
- 安卓设备如何ROOT?玩转ROOT,让你的安卓手机更强更好用
- 电脑开机密码忘了怎么办
- error: .repo/manifests/: contains uncommitted changes 解决办法
- 性能之巅:常用性能分析方法
- shiro反序列化漏洞学习(工具+原理+复现)
- 如何将证件照的休闲装变职业装
- eclipse导入import git项目
- 首批通过!百度智能云曦灵平台获信通院数字人能力评测权威认证
热门文章
- ADO.NET 完整修改、删除、防字符串攻击
- Internet信息服务找不到
- SkinSharp用法
- SQLServer的三种Recovery Model
- java整段标记_聊聊JAVA GC系列(7) - 标记整理算法
- 从零开始学前端:表格制作 --- 今天你学习了吗?(CSS:Day04)
- java实现展示框,如何使用纯CSS实现蝴蝶标本的展示框效果
- python把csv文件转换txt_Python实现txt文件转csv格式
- 微课|Python列表、字典、集合、字符串对象常用方法串讲
- Python花式编程案例集锦(9):sorted()函数中消失的cmp参数