質問編集履歴
5
あ
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,80 +44,82 @@
|
|
44
44
|
|
45
45
|
```
|
46
46
|
|
47
|
+
|
48
|
+
|
49
|
+
upstream unicorn{
|
50
|
+
|
51
|
+
server unix:/tmp/unicorn.sock
|
52
|
+
|
53
|
+
fail_timeout=0;
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
|
47
59
|
server {
|
48
60
|
|
61
|
+
listen (IPアドレス):8080;
|
62
|
+
|
63
|
+
listen 80;
|
64
|
+
|
65
|
+
server_name (自分で決めたホスト名);
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
root /var/www/my_app/current/public;
|
70
|
+
|
71
|
+
client_max_body_size 4G;
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
location ~ ^/assets/ {
|
76
|
+
|
77
|
+
root /var/www/my_app/current/public;
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
49
|
-
|
83
|
+
location / {
|
84
|
+
|
50
|
-
|
85
|
+
root /var/www/my_app/current/public;
|
86
|
+
|
87
|
+
proxy_set_header X-Real-IP $remote_addr;
|
88
|
+
|
89
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
90
|
+
|
91
|
+
proxy_set_header Host $http_host;
|
92
|
+
|
93
|
+
proxy_redirect off;
|
94
|
+
|
95
|
+
autoindex on;
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
if (!-f $request_filename) {
|
100
|
+
|
51
|
-
s
|
101
|
+
proxy_pass http://unicorn;
|
102
|
+
|
52
|
-
|
103
|
+
break;
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
error_page 500 502 503 504 /500.html;
|
112
|
+
|
113
|
+
|
114
|
+
|
53
|
-
|
115
|
+
location = /500.html {
|
116
|
+
|
117
|
+
root /var/www/my_app/current/public;
|
118
|
+
|
119
|
+
}
|
54
120
|
|
55
121
|
}
|
56
122
|
|
57
|
-
|
58
|
-
|
59
|
-
listen (IPアドレス):8080;
|
60
|
-
|
61
|
-
listen 80;
|
62
|
-
|
63
|
-
server_name (自分で決めたホスト名);
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
root /var/www/my_app/current/public;
|
68
|
-
|
69
|
-
client_max_body_size 4G;
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
location ~ ^/assets/ {
|
74
|
-
|
75
|
-
root /var/www/my_app/current/public;
|
76
|
-
|
77
|
-
}
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
location / {
|
82
|
-
|
83
|
-
root /var/www/my_app/current/public;
|
84
|
-
|
85
|
-
proxy_set_header X-Real-IP $remote_addr;
|
86
|
-
|
87
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
88
|
-
|
89
|
-
proxy_set_header Host $http_host;
|
90
|
-
|
91
|
-
proxy_redirect off;
|
92
|
-
|
93
|
-
autoindex on;
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
if (!-f $request_filename) {
|
98
|
-
|
99
|
-
proxy_pass http://unicorn;
|
100
|
-
|
101
|
-
break;
|
102
|
-
|
103
|
-
}
|
104
|
-
|
105
|
-
}
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
error_page 500 502 503 504 /500.html;
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
location = /500.html {
|
114
|
-
|
115
|
-
root /var/www/my_app/current/public;
|
116
|
-
|
117
|
-
}
|
118
|
-
|
119
|
-
}
|
120
|
-
|
121
123
|
```
|
122
124
|
|
123
125
|
### Unicorn.rb
|
4
内容改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,13 +30,9 @@
|
|
30
30
|
|
31
31
|
・ さくらVPS / CentOS 6.8 / rails 4.2.6 / Nginx 1.10.1 / Capistrano3/
|
32
32
|
|
33
|
-
・ chmod 755 -R /var/www/my_app/ 済
|
34
|
-
|
35
|
-
・ Nginx の起動は sudo で行っている
|
36
|
-
|
37
|
-
・ Unicorn は bundle exec unicorn_rails -c config/unicorn.rb -D -E staging で起動
|
33
|
+
・ Unicorn は bundle exec unicorn_rails -c config/unicorn.rb -D -E staging で起動確認済み
|
38
|
-
|
39
|
-
|
34
|
+
|
35
|
+
|
40
36
|
|
41
37
|
|
42
38
|
|
@@ -50,6 +46,16 @@
|
|
50
46
|
|
51
47
|
server {
|
52
48
|
|
49
|
+
upstream unicorn{
|
50
|
+
|
51
|
+
server unix:/tmp/unicorn.sock
|
52
|
+
|
53
|
+
fail_timeout=0;
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
|
53
59
|
listen (IPアドレス):8080;
|
54
60
|
|
55
61
|
listen 80;
|
3
改正
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
listen 80;
|
56
56
|
|
57
|
-
server_name
|
57
|
+
server_name (自分で決めたホスト名);
|
58
58
|
|
59
59
|
|
60
60
|
|
2
内容変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Nginx で
|
1
|
+
Nginx で Unicorn起動時、白い画面にNot Found: / の表示 (Rails)
|
test
CHANGED
@@ -16,15 +16,13 @@
|
|
16
16
|
|
17
17
|
###実現したいこと
|
18
18
|
|
19
|
-
当該IPアドレスを入力した時の
|
19
|
+
当該IPアドレスを入力した時にアプリの画面表示
|
20
20
|
|
21
21
|
|
22
22
|
|
23
23
|
###エラーメッセージ
|
24
24
|
|
25
|
-
|
25
|
+
白いページに Not Found: /
|
26
|
-
|
27
|
-
directory index of "/var/www/my_app/" is forbidden
|
28
26
|
|
29
27
|
|
30
28
|
|
@@ -50,50 +48,70 @@
|
|
50
48
|
|
51
49
|
```
|
52
50
|
|
51
|
+
server {
|
52
|
+
|
53
|
+
listen (IPアドレス):8080;
|
54
|
+
|
55
|
+
listen 80;
|
56
|
+
|
57
|
+
server_name asiainfonet.com;
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
root /var/www/my_app/current/public;
|
62
|
+
|
63
|
+
client_max_body_size 4G;
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
location ~ ^/assets/ {
|
68
|
+
|
69
|
+
root /var/www/my_app/current/public;
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
|
53
|
-
|
75
|
+
location / {
|
76
|
+
|
54
|
-
|
77
|
+
root /var/www/my_app/current/public;
|
78
|
+
|
79
|
+
proxy_set_header X-Real-IP $remote_addr;
|
80
|
+
|
81
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
82
|
+
|
83
|
+
proxy_set_header Host $http_host;
|
84
|
+
|
85
|
+
proxy_redirect off;
|
86
|
+
|
87
|
+
autoindex on;
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
if (!-f $request_filename) {
|
92
|
+
|
55
|
-
|
93
|
+
proxy_pass http://unicorn;
|
94
|
+
|
56
|
-
|
95
|
+
break;
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
error_page 500 502 503 504 /500.html;
|
104
|
+
|
105
|
+
|
106
|
+
|
57
|
-
|
107
|
+
location = /500.html {
|
108
|
+
|
109
|
+
root /var/www/my_app/current/public;
|
110
|
+
|
111
|
+
}
|
58
112
|
|
59
113
|
}
|
60
114
|
|
61
|
-
|
62
|
-
|
63
|
-
server {
|
64
|
-
|
65
|
-
listen 8080;
|
66
|
-
|
67
|
-
listen 80;
|
68
|
-
|
69
|
-
server_name ✖︎✖︎✖︎.✖︎✖︎.✖︎✖︎✖︎.✖︎✖︎✖︎;(IPアドレスを直接入力)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
root /var/www/my_app/current/public; ※my_appはアプリ名です
|
74
|
-
|
75
|
-
client_max_body_size 4G;
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
location @unicorn {
|
80
|
-
|
81
|
-
index index.html index.htm;
|
82
|
-
|
83
|
-
proxy_set_header X-Real-IP $remote_addr;
|
84
|
-
|
85
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
86
|
-
|
87
|
-
proxy_set_header Host $http_host;
|
88
|
-
|
89
|
-
proxy_pass http://unicorn;
|
90
|
-
|
91
|
-
autoindex on;
|
92
|
-
|
93
|
-
}
|
94
|
-
|
95
|
-
}
|
96
|
-
|
97
115
|
```
|
98
116
|
|
99
117
|
### Unicorn.rb
|
@@ -170,24 +188,20 @@
|
|
170
188
|
|
171
189
|
end
|
172
190
|
|
173
|
-
|
174
|
-
|
175
191
|
```
|
176
192
|
|
177
193
|
|
178
194
|
|
179
195
|
###試したこと
|
180
196
|
|
181
|
-
・80番ポート/8080番ポートどちら試しても繋がらない
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
###疑問
|
186
|
-
|
187
|
-
・
|
197
|
+
・Unicon停止した状態で、IPアドレスに接続を図る
|
188
|
-
|
198
|
+
|
189
|
-
|
199
|
+
└ Rails の We're sorry, but something went wrong. が表示
|
200
|
+
|
190
|
-
|
201
|
+
└ to unix:/tmp/unicorn.sock failed to unix:/tmp/unicorn.sock failed (111: Connection refused)
|
202
|
+
|
191
|
-
|
203
|
+
・Unicorn 起動
|
192
|
-
|
204
|
+
|
193
|
-
|
205
|
+
└ 白い画面にNot Found: /
|
206
|
+
|
207
|
+
└ エラーログなし
|
1
文章の改善
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Nginx で 403 Forbidden エラー
|
1
|
+
Nginx で 403 Forbidden エラーが出てしまう
|
test
CHANGED
@@ -184,8 +184,10 @@
|
|
184
184
|
|
185
185
|
###疑問
|
186
186
|
|
187
|
-
・unicorn.sock
|
187
|
+
・unicorn.sockがどこにあるのか分かっていません。
|
188
188
|
|
189
189
|
こちらは自動的に生成されるものなのでしょうか?こちらの設定が間違っているのでしょうか。
|
190
190
|
|
191
191
|
他サイトの記述を参考に書きました。
|
192
|
+
|
193
|
+
(無知の中質問し、申し訳ございません)
|