質問編集履歴
1
回答に対する動作
title
CHANGED
File without changes
|
body
CHANGED
@@ -97,4 +97,59 @@
|
|
97
97
|
server.ListenAndServe()
|
98
98
|
}
|
99
99
|
```
|
100
|
-
ソースは環境構築のために簡単に書いたものです。centos6上にgoとngnixの環境を作成する目的は、https通信の環境を作るためです。
|
100
|
+
ソースは環境構築のために簡単に書いたものです。centos6上にgoとngnixの環境を作成する目的は、https通信の環境を作るためです。
|
101
|
+
|
102
|
+
設定を以下のように変更しました。
|
103
|
+
しかし、うまくいきません。
|
104
|
+
error.logを見ると、接続できていないみたいです。
|
105
|
+
どのようにすれば、よろしいのでしょうか。
|
106
|
+
// default.conf
|
107
|
+
```ここに言語を入力
|
108
|
+
#
|
109
|
+
# The default server
|
110
|
+
#
|
111
|
+
|
112
|
+
server {
|
113
|
+
listen 81 default_server;
|
114
|
+
listen [::]:81 default_server;
|
115
|
+
server_name localhost;
|
116
|
+
root /usr/share/nginx/html;
|
117
|
+
|
118
|
+
# Load configuration files for the default server block.
|
119
|
+
include /etc/nginx/default.d/*.conf;
|
120
|
+
|
121
|
+
location / {
|
122
|
+
}
|
123
|
+
|
124
|
+
error_page 404 /404.html;
|
125
|
+
location = /40x.html {
|
126
|
+
}
|
127
|
+
|
128
|
+
error_page 500 502 503 504 /50x.html;
|
129
|
+
location = /50x.html {
|
130
|
+
}
|
131
|
+
|
132
|
+
}
|
133
|
+
```
|
134
|
+
|
135
|
+
|
136
|
+
// golang.conf
|
137
|
+
|
138
|
+
```ここに言語を入力
|
139
|
+
server {
|
140
|
+
listen 80 default_server;
|
141
|
+
server_name 192.168.33.10;
|
142
|
+
|
143
|
+
location / {
|
144
|
+
fastcgi_pass 192.168.33.10:9000;
|
145
|
+
include fastcgi_params;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
```
|
150
|
+
/var/log/nginx/error.log
|
151
|
+
```ここに言語を入力
|
152
|
+
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"
|
153
|
+
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"
|
154
|
+
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"
|
155
|
+
```
|