質問編集履歴

4

出直し

2017/05/05 05:29

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -229,3 +229,7 @@
229
229
  JavaScriptはyuicompressor+jsPacker.plで圧縮しています。
230
230
 
231
231
  nginxのリバースプロクシを利用してSSL化をしているので、コンテンツサーバー側はhttpでアクセスされます。
232
+
233
+
234
+
235
+ 出直し先:https://teratail.com/questions/74943

3

nginx\.conf変更

2017/05/05 05:29

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -154,12 +154,74 @@
154
154
 
155
155
  rawタグに基いて、以下のOpen Graphプロパティが構築されました
156
156
 
157
- (以下全部正常に認識してます)
158
-
159
157
  ----------------
160
158
 
161
159
 
162
160
 
161
+ ###試したこと追記 20170504
162
+
163
+ https://example.com/ (いいねの存在するTOPページ) だけ表示されなく
164
+
165
+ https://example.com/page.html 等はいいねが表示されているため、
166
+
167
+ nginx を以下のように変更して様子見中。
168
+
169
+
170
+
171
+ ```nginx
172
+
173
+ server {
174
+
175
+ listen 80;
176
+
177
+ server_name example.com;
178
+
179
+
180
+
181
+ proxy_set_header Host $host;
182
+
183
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
184
+
185
+ proxy_set_header X-Forwarded-Host $host;
186
+
187
+ proxy_set_header X-Forwarded-Server $host;
188
+
189
+ proxy_set_header X-Real-IP $remote_addr;
190
+
191
+
192
+
193
+ # Facebook only
194
+
195
+ location ~* {
196
+
197
+ proxy_cache zone1;
198
+
199
+ proxy_cache_key "$scheme://$host$request_uri$is_args$args";
200
+
201
+ proxy_cache_valid 200 1s;
202
+
203
+ if ($http_user_agent ~ facebookexternalhit) {
204
+
205
+ proxy_pass http://10.0.0.***:*****;
206
+
207
+ }
208
+
209
+ if ($http_user_agent !~ facebookexternalhit) {
210
+
211
+ rewrite ^(.*) https://$host$1 last;
212
+
213
+ }
214
+
215
+
216
+
217
+ }
218
+
219
+ }
220
+
221
+ ```
222
+
223
+
224
+
163
225
  ###補足情報(言語/FW/ツール等のバージョンなど)
164
226
 
165
227
  HTMLは日本語を&#xxxx;化しています。

2

FBデバッガー

2017/05/04 01:47

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -132,6 +132,34 @@
132
132
 
133
133
  ```
134
134
 
135
+
136
+
137
+ Facebookデバッガーの結果
138
+
139
+ ----------------
140
+
141
+ スクレイピングの実行時間 7分前
142
+
143
+ レスポンスコード 200
144
+
145
+ 取得したURL https://ほげほげ/
146
+
147
+ カノニカルURL https://ほげほげ/ 2件のいいね!、シェア、コメント(詳細)
148
+
149
+ リンクをプレビュー (正常)
150
+
151
+ サーバーIP ほげほげ
152
+
153
+
154
+
155
+ rawタグに基いて、以下のOpen Graphプロパティが構築されました
156
+
157
+ (以下全部正常に認識してます)
158
+
159
+ ----------------
160
+
161
+
162
+
135
163
  ###補足情報(言語/FW/ツール等のバージョンなど)
136
164
 
137
165
  HTMLは日本語を&#xxxx;化しています。

1

公式からとってきたHTMLでも動作しない

2017/05/02 07:28

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -94,6 +94,44 @@
94
94
 
95
95
 
96
96
 
97
+ https://developers.facebook.com/docs/plugins/like-button?locale=ja_JP
98
+
99
+ でとってきたコードすら動きませんでした。
100
+
101
+ http:// の別のサイトに置くと表示されます。
102
+
103
+
104
+
105
+ ```HTML
106
+
107
+ <html>
108
+
109
+ <body>
110
+
111
+ <div id="fb-root"></div>
112
+
113
+ <script>(function(d, s, id) {
114
+
115
+ var js, fjs = d.getElementsByTagName(s)[0];
116
+
117
+ if (d.getElementById(id)) return;
118
+
119
+ js = d.createElement(s); js.id = id;
120
+
121
+ js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.9";
122
+
123
+ fjs.parentNode.insertBefore(js, fjs);
124
+
125
+ }(document, 'script', 'facebook-jssdk'));</script>
126
+
127
+ <div class="fb-like" data-href="https://example.com/" data-layout="standard" data-action="like" data-size="small" data-show-faces="true" data-share="true"></div>
128
+
129
+ </body>
130
+
131
+ </html>
132
+
133
+ ```
134
+
97
135
  ###補足情報(言語/FW/ツール等のバージョンなど)
98
136
 
99
137
  HTMLは日本語を&#xxxx;化しています。