質問編集履歴

1

Nginxの設定を追記

2019/10/19 08:02

投稿

jooooz_jjj
jooooz_jjj

スコア4

test CHANGED
File without changes
test CHANGED
@@ -308,6 +308,8 @@
308
308
 
309
309
 
310
310
 
311
+
312
+
311
313
  #nginx再起動
312
314
 
313
315
  sudo service nginx restart
@@ -322,6 +324,188 @@
322
324
 
323
325
 
324
326
 
327
+ #Nginxの状態追記
328
+
329
+
330
+
331
+
332
+
333
+ upstream puma {
334
+
335
+
336
+
337
+ server unix:///home/ec2-user/first_portfolio/tmp/sockets/puma.sock;
338
+
339
+
340
+
341
+ }
342
+
343
+
344
+
345
+ server {
346
+
347
+
348
+
349
+ server_name melhealhabit.com;
350
+
351
+
352
+
353
+ root /home/ec2-user/first_portfolio/public;
354
+
355
+
356
+
357
+
358
+
359
+ access_log /var/log/nginx/access.log main;
360
+
361
+
362
+
363
+ error_log /var/log/nginx/error.log;
364
+
365
+
366
+
367
+ sendfile on;
368
+
369
+
370
+
371
+   tcp_nopush on;
372
+
373
+
374
+
375
+ tcp_nodelay on;
376
+
377
+
378
+
379
+ keepalive_timeout 65;
380
+
381
+
382
+
383
+
384
+
385
+ types_hash_max_size 2048;
386
+
387
+
388
+
389
+ include /etc/nginx/mime.types;
390
+
391
+
392
+
393
+ location / {
394
+
395
+
396
+
397
+ proxy_pass http://puma;
398
+
399
+
400
+
401
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
402
+
403
+
404
+
405
+ proxy_set_header Host $http_host;
406
+
407
+
408
+
409
+      proxy_set_header X-Real-IP $remote_addr;
410
+
411
+
412
+
413
+ proxy_redirect off;
414
+
415
+
416
+
417
+ proxy_connect_timeout 30;
418
+
419
+
420
+
421
+
422
+
423
+ }
424
+
425
+
426
+
427
+
428
+
429
+ error_page 500 502 503 504 /50x.html;
430
+
431
+
432
+
433
+
434
+
435
+ location = /50x.html {
436
+
437
+
438
+
439
+ root /home/ec2-user/first_portfolio/public;
440
+
441
+
442
+
443
+ }
444
+
445
+
446
+
447
+ listen 443 ssl; # managed by Certbot
448
+
449
+ ssl_certificate /etc/letsencrypt/live/melhealhabit.com/fullchain.pem; # managed by Certbot
450
+
451
+ ssl_certificate_key /etc/letsencrypt/live/melhealhabit.com/privkey.pem; # managed by Certbot
452
+
453
+ include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
454
+
455
+ ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
456
+
457
+
458
+
459
+
460
+
461
+ }
462
+
463
+
464
+
465
+ server {
466
+
467
+ if ($host = melhealhabit.com) {
468
+
469
+ return 301 https://$host$request_uri;
470
+
471
+ } # managed by Certbot
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+ listen 80;
480
+
481
+
482
+
483
+ server_name melhealhabit.com;
484
+
485
+ return 404; # managed by Certbot
486
+
487
+
488
+
489
+ }
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+      
502
+
503
+
504
+
505
+
506
+
507
+
508
+
325
509
  ### 補足情報(FW/ツールのバージョンなど)
326
510
 
327
511