greyfreedom 最近的时间轴更新
greyfreedom

greyfreedom

V2EX 第 94016 号会员,加入于 2015-01-27 09:39:32 +08:00
greyfreedom 最近回复了
2015-11-30 22:57:54 +08:00
回复了 Andor_Chen 创建的主题 Java 送几本《Java 技术手册(第 6 版)》
谢谢楼主哟。希望人品爆发,希望楼主快乐
@wql @Starduster 同志们,我解决了。。。。虽然我也不知道什么原因弄好的。。。
我把配置文件贴一下,以便以后侥幸能够帮助有同样问题的人。
谢谢各位。谢谢。
location / {
if (!-f $request_filename){
set $rule_1 1$rule_1;
}
if (!-d $request_filename){
set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
rewrite /. /blog/index.php last;
}
try_files $uri $uri/ /index.php;

}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@wql 换成你这句还是不行。我把以前的转货过来的规则删掉了以后可以登录后台了,但是现在文章点开都是 404.。。。
我现在的配置文件是这样的:
location / {
try_files $uri $uri/ /index.php;

}

error_page 404 /404.html;


error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}

以前直接转换规则的时候的 location /里面是这样的
location / {
try_files $uri $uri/ /index.php;
#ignored: "-" thing used or unknown variable in regex/rew
if (!-f $request_filename){
set $rule_1 1$rule_1;
}
if (!-d $request_filename){
set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
rewrite /. /blog/index.php last;
}

}

现在情况是这样的:
如果是第一种配置,可以访问后台页面,且没有问题。但是所有文章、分类,下一页等连接都是 404.
如果是第二种情况,所有文章、分类、下一页都没问题。但是后台登陆页面可以访问,点击登陆后重定向过多,无法进入控制台。
@Starduster 换成你这句还是不行。我把以前的转货过来的规则删掉了以后可以登录后台了,但是现在文章点开都是 404.。。。
我现在的配置文件是这样的:
location / {
try_files $uri $uri/ /index.php;

}

error_page 404 /404.html;


error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}

以前直接转换规则的时候的 location /里面是这样的
location / {
try_files $uri $uri/ /index.php;
#ignored: "-" thing used or unknown variable in regex/rew
if (!-f $request_filename){
set $rule_1 1$rule_1;
}
if (!-d $request_filename){
set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
rewrite /. /blog/index.php last;
}

}

现在情况是这样的:
如果是第一种配置,可以访问后台页面,且没有问题。但是所有文章、分类,下一页等连接都是 404.
如果是第二种情况,所有文章、分类、下一页都没问题。但是后台登陆页面可以访问,点击登陆后重定向过多,无法进入控制台。
@Starduster 我是使用一个 apach rewrite 规则转换到 nginx rewrite 规则的网站转换的。我不太懂那个规则
2015-02-25 22:21:58 +08:00
回复了 jason52 创建的主题 分享创造 手把手写爬虫之第三弹--流量分析嗅探简介
学习一下,最近刚好要学习爬虫。谢楼主分享
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3142 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 14:43 · PVG 22:43 · LAX 07:43 · JFK 10:43
Developed with CodeLauncher
♥ Do have faith in what you're doing.