質問編集履歴

2

文章の修正

2021/12/08 07:15

投稿

Ko-program
Ko-program

スコア11

test CHANGED
File without changes
test CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  *以下設定ファイルの内容
16
16
 
17
- # log directory
17
+ log directory
18
18
 
19
19
  error_log /var/www/rails/アプリ名/log/nginx.error.log;
20
20
 
@@ -22,13 +22,13 @@
22
22
 
23
23
 
24
24
 
25
- # max body size
25
+ max body size
26
26
 
27
27
  client_max_body_size 2G;
28
28
 
29
29
  upstream app_server {
30
30
 
31
- # for UNIX domain socket setups
31
+ for UNIX domain socket setups
32
32
 
33
33
  server unix:/var/www/rails/アプリ名/run/sockets/unicorn.sock fail_timeout=0;
34
34
 
@@ -44,17 +44,17 @@
44
44
 
45
45
 
46
46
 
47
- # nginx so increasing this is generally safe...
47
+ nginx so increasing this is generally safe...
48
48
 
49
49
  keepalive_timeout 5;
50
50
 
51
- # path for static files
51
+ path for static files
52
52
 
53
53
  root /var/www/rails/アプリ名/public;
54
54
 
55
55
 
56
56
 
57
- # page cache loading
57
+ page cache loading
58
58
 
59
59
  try_files $uri/index.html $uri.html $uri @app;
60
60
 
@@ -62,7 +62,7 @@
62
62
 
63
63
  location @app {
64
64
 
65
- # HTTP headers
65
+ HTTP headers
66
66
 
67
67
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
68
68
 
@@ -76,7 +76,7 @@
76
76
 
77
77
 
78
78
 
79
- # Rails error pages
79
+ Rails error pages
80
80
 
81
81
  error_page 500 502 503 504 /500.html;
82
82
 

1

ファイルの内容の追記

2021/12/08 07:15

投稿

Ko-program
Ko-program

スコア11

test CHANGED
File without changes
test CHANGED
@@ -9,6 +9,86 @@
9
9
 
10
10
 
11
11
  こちらのサイトの「本番環境構築」の「Nginxのインストール」まで進めたのですが、
12
+
13
+
14
+
15
+ *以下設定ファイルの内容
16
+
17
+ # log directory
18
+
19
+ error_log /var/www/rails/アプリ名/log/nginx.error.log;
20
+
21
+ access_log /var/www/rails/アプリ名/log/nginx.access.log;
22
+
23
+
24
+
25
+ # max body size
26
+
27
+ client_max_body_size 2G;
28
+
29
+ upstream app_server {
30
+
31
+ # for UNIX domain socket setups
32
+
33
+ server unix:/var/www/rails/アプリ名/run/sockets/unicorn.sock fail_timeout=0;
34
+
35
+ }
36
+
37
+ server {
38
+
39
+ listen 80;
40
+
41
+
42
+
43
+ server_name ; ElasticIP;
44
+
45
+
46
+
47
+ # nginx so increasing this is generally safe...
48
+
49
+ keepalive_timeout 5;
50
+
51
+ # path for static files
52
+
53
+ root /var/www/rails/アプリ名/public;
54
+
55
+
56
+
57
+ # page cache loading
58
+
59
+ try_files $uri/index.html $uri.html $uri @app;
60
+
61
+
62
+
63
+ location @app {
64
+
65
+ # HTTP headers
66
+
67
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
68
+
69
+ proxy_set_header Host $http_host;
70
+
71
+ proxy_redirect off;
72
+
73
+ proxy_pass http://app_server;
74
+
75
+ }
76
+
77
+
78
+
79
+ # Rails error pages
80
+
81
+ error_page 500 502 503 504 /500.html;
82
+
83
+ location = /500.html {
84
+
85
+ root /var/www/rails/アプリ名/public;
86
+
87
+ }
88
+
89
+ }
90
+
91
+
12
92
 
13
93
  その中の設定ファイルの作成した後に、ファイルの設定内容をNginxに反映させて再起動しようとしたものの、
14
94