Facebook Scraped URL 404并欢迎使用Nginx错误[Ningx + PHP-FPM]

时间:2014-05-17 08:33:08

标签: php facebook facebook-graph-api nginx

我的问题就是:当我在Facebook上分享我的网站网址时,会显示一个" 404 Not Found"标题或"欢迎来到Ningx"名称

我是Ningx的新手,我正在使用Debain Linux(Ningx + PHP-FPM)配置。 托管在此服务器上的所有站点都有问题通过Facebook(开放图)

来欺骗信息

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fopenspeedtest.com%2F

og:url  http://openspeedtest.com/
og:type website
og:title    Welcome to nginx!
og:updated_time 1400314069

404 Note Found Example ----> https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fshar.es%2FV1oDa&t=Internet+Speed+Test+for+Any+Device%2C+Any+Broadband+-+OpenSpeedTest.com 欢迎来到Ningx示例---> https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fshar.es%2FV1WWn&t=Check+out+my+Internet+SpeedTest+results.+What%27s+your+speed%3F

我没有写" og"我的旧网站的标签例如:https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fcheckinternetspeed.in%2F我的服务器也出现了同样的错误。

我测试了不同的Ningx配置来解决这个问题但是失败了。 Google+正在从我的服务器上获取正确的标题和图片。

3 个答案:

答案 0 :(得分:9)

我在谷歌上浪费了5个多小时来解决这个问题,最后我得到了托管服务提供商的帮助。 由于IPV6地址发生此问题。 Facebook默认使用IPV6地址(如果可用)。我的VPS启用了IPV6。

要解决此问题,您必须在所有Ningx配置文件中为每个虚拟主机(如果托管多个站点)启用iPv6以侦听端口80上的任何IPv6地址。

这将解决Facebook opengraph的问题。

或者,您可以完全禁用IPV6地址来解决此问题。

答案 1 :(得分:2)

谢谢,禁用IPv6修复了这个非常烦人的问题。我一直在遇到其他答案,表明问题来自ModSecurity,Nginx配置,htaccess,WordPress插件或设置,但最终问题是因为我的服务器上启用了IPv6。我没有尝试@ Vishnu的修复,而是选择完全禁用IPv6,因为我还是不使用IPv6。

以下是我在Linode Ubuntu服务器上禁用IPv6的方法:

1. sudo nano /etc/sysctl.conf

2. Add these lines to the bottom of the file:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

3. sudo nano /etc/default/bind9

4. Edit the file as follows:
# run resolvconf? 
RESOLVCONF=yes 
# startup options for the server 
OPTIONS="-4 -u bind" - 

答案 2 :(得分:0)

只需更改您的nginx配置并监听[::]:80而不是:80