質問編集履歴
3
nginx設定ファイルを記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -188,6 +188,116 @@
|
|
188
188
|
|
189
189
|
|
190
190
|
|
191
|
+
nginx設定ファイル
|
192
|
+
|
193
|
+
*.conf
|
194
|
+
|
195
|
+
```conf
|
196
|
+
|
197
|
+
error_log /var/www/rails/*/log/nginx.error.log;
|
198
|
+
|
199
|
+
access_log /var/www/rails/*/log/nginx.access.log;
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
upstream unicorn_server {
|
204
|
+
|
205
|
+
server unix:/var/www/rails/*/tmp/sockets/.unicorn.sock fail_timeout=0;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
server {
|
212
|
+
|
213
|
+
listen 80;
|
214
|
+
|
215
|
+
client_max_body_size 4G;
|
216
|
+
|
217
|
+
server_name www.*.co.jp *.co.jp;
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
# webサーバとクライアントの通信時にHTTP通信をタイムアウトせずに待つ秒数
|
222
|
+
|
223
|
+
keepalive_timeout 5;
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
# Location of our static files
|
228
|
+
|
229
|
+
root /var/www/rails/*/public; #自分のアプリケーション名に変更
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
location ~ ^/assets/ {
|
234
|
+
|
235
|
+
root /var/www/rails/*/public; #自分のアプリケーション名に変更
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
location / {
|
242
|
+
|
243
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
244
|
+
|
245
|
+
proxy_set_header Host $http_host;
|
246
|
+
|
247
|
+
proxy_redirect off;
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
if (!-f $request_filename) {
|
252
|
+
|
253
|
+
proxy_pass http://unicorn_server;
|
254
|
+
|
255
|
+
break;
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
location /cable {
|
266
|
+
|
267
|
+
proxy_pass http://unicorn_server/cable;
|
268
|
+
|
269
|
+
proxy_http_version 1.1;
|
270
|
+
|
271
|
+
proxy_set_header Upgrade websocket;
|
272
|
+
|
273
|
+
proxy_set_header Connection Upgrade;
|
274
|
+
|
275
|
+
proxy_set_header X-Real-IP $remote_addr;
|
276
|
+
|
277
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
278
|
+
|
279
|
+
proxy_set_header X-Forwarded-Proto https;
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
error_page 500 502 503 504 /500.html;
|
288
|
+
|
289
|
+
location = /500.html {
|
290
|
+
|
291
|
+
root /var/www/rails/*/public; #自分のアプリケーション名に変更
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
}
|
296
|
+
|
297
|
+
```
|
298
|
+
|
299
|
+
|
300
|
+
|
191
301
|
log/production.log の該当範囲をみてもエラーなどはないように見受けました。
|
192
302
|
|
193
303
|
|
2
コード記載ミス修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -128,7 +128,7 @@
|
|
128
128
|
|
129
129
|
def post(data)
|
130
130
|
|
131
|
-
ActionCable.server.broadcast('c
|
131
|
+
ActionCable.server.broadcast('function_channel', data)
|
132
132
|
|
133
133
|
end
|
134
134
|
|
1
コードのペーストミスを修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -92,7 +92,7 @@
|
|
92
92
|
|
93
93
|
button.addEventListener('click', function () {
|
94
94
|
|
95
|
-
App.c
|
95
|
+
App.function.post("hoge");
|
96
96
|
|
97
97
|
});
|
98
98
|
|
@@ -146,7 +146,7 @@
|
|
146
146
|
|
147
147
|
```
|
148
148
|
|
149
|
-
App.c
|
149
|
+
App.function = App.cable.subscriptions.create("functionChannel", {
|
150
150
|
|
151
151
|
connected: function() {
|
152
152
|
|