質問編集履歴

1

回答に対する動作

2017/10/22 04:39

投稿

UekiKouji
UekiKouji

スコア121

test CHANGED
File without changes
test CHANGED
@@ -197,3 +197,113 @@
197
197
  ```
198
198
 
199
199
  ソースは環境構築のために簡単に書いたものです。centos6上にgoとngnixの環境を作成する目的は、https通信の環境を作るためです。
200
+
201
+
202
+
203
+ 設定を以下のように変更しました。
204
+
205
+ しかし、うまくいきません。
206
+
207
+ error.logを見ると、接続できていないみたいです。
208
+
209
+ どのようにすれば、よろしいのでしょうか。
210
+
211
+ // default.conf
212
+
213
+ ```ここに言語を入力
214
+
215
+ #
216
+
217
+ # The default server
218
+
219
+ #
220
+
221
+
222
+
223
+ server {
224
+
225
+ listen 81 default_server;
226
+
227
+ listen [::]:81 default_server;
228
+
229
+ server_name localhost;
230
+
231
+ root /usr/share/nginx/html;
232
+
233
+
234
+
235
+ # Load configuration files for the default server block.
236
+
237
+ include /etc/nginx/default.d/*.conf;
238
+
239
+
240
+
241
+ location / {
242
+
243
+ }
244
+
245
+
246
+
247
+ error_page 404 /404.html;
248
+
249
+ location = /40x.html {
250
+
251
+ }
252
+
253
+
254
+
255
+ error_page 500 502 503 504 /50x.html;
256
+
257
+ location = /50x.html {
258
+
259
+ }
260
+
261
+
262
+
263
+ }
264
+
265
+ ```
266
+
267
+
268
+
269
+
270
+
271
+ // golang.conf
272
+
273
+
274
+
275
+ ```ここに言語を入力
276
+
277
+ server {
278
+
279
+ listen 80 default_server;
280
+
281
+ server_name 192.168.33.10;
282
+
283
+
284
+
285
+ location / {
286
+
287
+ fastcgi_pass 192.168.33.10:9000;
288
+
289
+ include fastcgi_params;
290
+
291
+ }
292
+
293
+ }
294
+
295
+
296
+
297
+ ```
298
+
299
+ /var/log/nginx/error.log
300
+
301
+ ```ここに言語を入力
302
+
303
+ 2017/10/22 05:28:15 [error] 15847#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.33.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.33.10"
304
+
305
+ 2017/10/22 05:31:46 [error] 15934#0: *1 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 192.168.33.1, server: 192.168.33.10, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.33.10:9000", host: "192.168.33.10"
306
+
307
+ 2017/10/22 05:31:48 [error] 15934#0: *1 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 192.168.33.1, server: 192.168.33.10, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.33.10:9000", host: "192.168.33.10"
308
+
309
+ ```