質問編集履歴

4

誤字

2017/02/06 09:53

投稿

nk117
nk117

スコア31

test CHANGED
@@ -1 +1 @@
1
- Nginx nginx.conf ではなく アプリ名.confを読ませたい場合
1
+ 誤字Nginx nginx.conf ではなく アプリ名.confを読ませたい場合
test CHANGED
@@ -30,14 +30,6 @@
30
30
 
31
31
 
32
32
 
33
- # For more information on configuration, see:
34
-
35
- # * Official English Documentation: http://nginx.org/en/docs/
36
-
37
- # * Official Russian Documentation: http://nginx.org/ru/docs/
38
-
39
-
40
-
41
33
  user nginx;
42
34
 
43
35
  worker_processes auto;
@@ -47,8 +39,6 @@
47
39
  pid /var/run/nginx.pid;
48
40
 
49
41
 
50
-
51
- # Load dynamic modules. See /usr/share/nginx/README.fedora.
52
42
 
53
43
  include /usr/share/nginx/modules/*.conf;
54
44
 
@@ -94,11 +84,7 @@
94
84
 
95
85
 
96
86
 
97
- # Load modular configuration files from the /etc/nginx/conf.d directory.
87
+
98
-
99
- # See http://nginx.org/en/docs/ngx_core_module.html#include
100
-
101
- # for more information.
102
88
 
103
89
  include /etc/nginx/conf.d/*.conf;
104
90
 
@@ -120,7 +106,7 @@
120
106
 
121
107
 
122
108
 
123
- # Load configuration files for the default server block.
109
+
124
110
 
125
111
  include /etc/nginx/default.d/*.conf;
126
112
 
@@ -132,9 +118,7 @@
132
118
 
133
119
 
134
120
 
135
- # redirect server error pages to the static page /40x.html
121
+
136
-
137
- #
138
122
 
139
123
  error_page 404 /404.html;
140
124
 
@@ -144,9 +128,7 @@
144
128
 
145
129
 
146
130
 
147
- # redirect server error pages to the static page /50x.html
131
+
148
-
149
- #
150
132
 
151
133
  error_page 500 502 503 504 /50x.html;
152
134
 
@@ -156,119 +138,19 @@
156
138
 
157
139
 
158
140
 
159
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
141
+
160
142
 
161
- #
143
+
162
-
163
- #location ~ \.php$ {
164
-
165
- # proxy_pass http://127.0.0.1;
166
-
167
- #}
168
-
169
-
170
-
171
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
172
-
173
- #
174
-
175
- #location ~ \.php$ {
176
-
177
- # root html;
178
-
179
- # fastcgi_pass 127.0.0.1:9000;
180
-
181
- # fastcgi_index index.php;
182
-
183
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
184
-
185
- # include fastcgi_params;
186
-
187
- #}
188
-
189
-
190
-
191
- # deny access to .htaccess files, if Apache's document root
192
-
193
- # concurs with nginx's one
194
-
195
- #
196
-
197
- #location ~ /\.ht {
198
-
199
- # deny all;
200
-
201
- #}
202
144
 
203
145
  }
204
146
 
205
147
 
206
148
 
207
- # Settings for a TLS enabled server.
149
+ /etc/pki/nginx/dhparams.pem 2048
208
150
 
209
- #
151
+ HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
210
152
 
211
- # server {
212
153
 
213
- # listen 443 ssl;
214
-
215
- # listen [::]:443 ssl;
216
-
217
- # server_name localhost;
218
-
219
- # root /usr/share/nginx/html;
220
-
221
- #
222
-
223
- # ssl_certificate "/etc/pki/nginx/server.crt";
224
-
225
- # ssl_certificate_key "/etc/pki/nginx/private/server.key";
226
-
227
- # # It is *strongly* recommended to generate unique DH parameters
228
-
229
- # # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
230
-
231
- # #ssl_dhparam "/etc/pki/nginx/dhparams.pem";
232
-
233
- # ssl_session_cache shared:SSL:1m;
234
-
235
- # ssl_session_timeout 10m;
236
-
237
- # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
238
-
239
- # ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
240
-
241
- # ssl_prefer_server_ciphers on;
242
-
243
- #
244
-
245
- # # Load configuration files for the default server block.
246
-
247
- # include /etc/nginx/default.d/*.conf;
248
-
249
- #
250
-
251
- # location / {
252
-
253
- # }
254
-
255
- #
256
-
257
- # error_page 404 /404.html;
258
-
259
- # location = /40x.html {
260
-
261
- # }
262
-
263
- #
264
-
265
- # error_page 500 502 503 504 /50x.html;
266
-
267
- # location = /50x.html {
268
-
269
- # }
270
-
271
- # }
272
154
 
273
155
 
274
156
 

3

追記

2017/02/06 09:53

投稿

nk117
nk117

スコア31

test CHANGED
File without changes
test CHANGED
@@ -23,3 +23,253 @@
23
23
  どうすればconf.d/app名.confを読み込むように設定できますか?
24
24
 
25
25
  アドバイスよろしくお願いします。
26
+
27
+
28
+
29
+ <以下nginx.confの内容>
30
+
31
+
32
+
33
+ # For more information on configuration, see:
34
+
35
+ # * Official English Documentation: http://nginx.org/en/docs/
36
+
37
+ # * Official Russian Documentation: http://nginx.org/ru/docs/
38
+
39
+
40
+
41
+ user nginx;
42
+
43
+ worker_processes auto;
44
+
45
+ error_log /var/log/nginx/error.log;
46
+
47
+ pid /var/run/nginx.pid;
48
+
49
+
50
+
51
+ # Load dynamic modules. See /usr/share/nginx/README.fedora.
52
+
53
+ include /usr/share/nginx/modules/*.conf;
54
+
55
+
56
+
57
+ events {
58
+
59
+ worker_connections 1024;
60
+
61
+ }
62
+
63
+
64
+
65
+ http {
66
+
67
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
68
+
69
+ '$status $body_bytes_sent "$http_referer" '
70
+
71
+ '"$http_user_agent" "$http_x_forwarded_for"';
72
+
73
+
74
+
75
+ access_log /var/log/nginx/access.log main;
76
+
77
+
78
+
79
+ sendfile off;
80
+
81
+ tcp_nopush on;
82
+
83
+ tcp_nodelay on;
84
+
85
+ keepalive_timeout 65;
86
+
87
+ types_hash_max_size 2048;
88
+
89
+
90
+
91
+ include /etc/nginx/mime.types;
92
+
93
+ default_type application/octet-stream;
94
+
95
+
96
+
97
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
98
+
99
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
100
+
101
+ # for more information.
102
+
103
+ include /etc/nginx/conf.d/*.conf;
104
+
105
+
106
+
107
+ index index.html index.htm;
108
+
109
+
110
+
111
+ server {
112
+
113
+ listen 80 default_server;
114
+
115
+ listen [::]:80 default_server;
116
+
117
+ server_name localhost;
118
+
119
+ root /usr/share/nginx/html;
120
+
121
+
122
+
123
+ # Load configuration files for the default server block.
124
+
125
+ include /etc/nginx/default.d/*.conf;
126
+
127
+
128
+
129
+ location / {
130
+
131
+ }
132
+
133
+
134
+
135
+ # redirect server error pages to the static page /40x.html
136
+
137
+ #
138
+
139
+ error_page 404 /404.html;
140
+
141
+ location = /40x.html {
142
+
143
+ }
144
+
145
+
146
+
147
+ # redirect server error pages to the static page /50x.html
148
+
149
+ #
150
+
151
+ error_page 500 502 503 504 /50x.html;
152
+
153
+ location = /50x.html {
154
+
155
+ }
156
+
157
+
158
+
159
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
160
+
161
+ #
162
+
163
+ #location ~ \.php$ {
164
+
165
+ # proxy_pass http://127.0.0.1;
166
+
167
+ #}
168
+
169
+
170
+
171
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
172
+
173
+ #
174
+
175
+ #location ~ \.php$ {
176
+
177
+ # root html;
178
+
179
+ # fastcgi_pass 127.0.0.1:9000;
180
+
181
+ # fastcgi_index index.php;
182
+
183
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
184
+
185
+ # include fastcgi_params;
186
+
187
+ #}
188
+
189
+
190
+
191
+ # deny access to .htaccess files, if Apache's document root
192
+
193
+ # concurs with nginx's one
194
+
195
+ #
196
+
197
+ #location ~ /\.ht {
198
+
199
+ # deny all;
200
+
201
+ #}
202
+
203
+ }
204
+
205
+
206
+
207
+ # Settings for a TLS enabled server.
208
+
209
+ #
210
+
211
+ # server {
212
+
213
+ # listen 443 ssl;
214
+
215
+ # listen [::]:443 ssl;
216
+
217
+ # server_name localhost;
218
+
219
+ # root /usr/share/nginx/html;
220
+
221
+ #
222
+
223
+ # ssl_certificate "/etc/pki/nginx/server.crt";
224
+
225
+ # ssl_certificate_key "/etc/pki/nginx/private/server.key";
226
+
227
+ # # It is *strongly* recommended to generate unique DH parameters
228
+
229
+ # # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
230
+
231
+ # #ssl_dhparam "/etc/pki/nginx/dhparams.pem";
232
+
233
+ # ssl_session_cache shared:SSL:1m;
234
+
235
+ # ssl_session_timeout 10m;
236
+
237
+ # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
238
+
239
+ # ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
240
+
241
+ # ssl_prefer_server_ciphers on;
242
+
243
+ #
244
+
245
+ # # Load configuration files for the default server block.
246
+
247
+ # include /etc/nginx/default.d/*.conf;
248
+
249
+ #
250
+
251
+ # location / {
252
+
253
+ # }
254
+
255
+ #
256
+
257
+ # error_page 404 /404.html;
258
+
259
+ # location = /40x.html {
260
+
261
+ # }
262
+
263
+ #
264
+
265
+ # error_page 500 502 503 504 /50x.html;
266
+
267
+ # location = /50x.html {
268
+
269
+ # }
270
+
271
+ # }
272
+
273
+
274
+
275
+ }

2

質問文の修正

2017/02/06 09:51

投稿

nk117
nk117

スコア31

test CHANGED
@@ -1 +1 @@
1
- HTTP ドメイン IPドレス Rails4 表示されな
1
+ Nginx nginx.conf ではなくプリ名.confを読ませた場合
test CHANGED
@@ -4,34 +4,22 @@
4
4
 
5
5
  Nginx
6
6
 
7
- Unicorn
8
-
9
- EC2
10
-
11
- お名前.com
12
-
13
- Route53
14
-
15
7
 
16
8
 
17
9
  目標
18
10
 
11
+ /nginx/nginx.conf ではなく、
12
+
19
- 独自のドメインでrails appを表示させたい。
13
+ /nginx/conf.d/app名.conf 読み込ませたい。
20
14
 
21
15
 
22
16
 
23
-
17
+
24
18
 
25
- ・Rails appをAWSを利用して公開中
26
-
27
- ・IPv4 Public IPとドメインの関連付けはできている(HTTP接続のチェックでドメインからIPv4 Public IPが確認できました。)
28
-
29
- ・DNSはお名前.comのデフォルトサーバを設定済み(nslookupコマンドにて確認できました。)
30
-
31
- ・Nginx,unicornは共に起動している。
32
-
33
- ・ドメインをgoogle検索すると、NginxのWelcome to nginx on the Amazon Linux AMI!が表示されます。IPでgoogle検索した場合は、正常にrails appが表示されています。
19
+ nginx.confのWelcome to nginx on the Amazon Linux AMI!が表示されています。
34
20
 
35
21
 
36
22
 
23
+ どうすればconf.d/app名.confを読み込むように設定できますか?
24
+
37
- この原因と改善方法を探しています。アドバイスよろしくお願いします。
25
+ アドバイスよろしくお願いします。

1

誤字

2017/02/06 08:07

投稿

nk117
nk117

スコア31

test CHANGED
File without changes
test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  現況
24
24
 
25
- ・Rails appをAWS公開している
25
+ ・Rails appをAWSを利用して公開
26
26
 
27
27
  ・IPv4 Public IPとドメインの関連付けはできている(HTTP接続のチェックでドメインからIPv4 Public IPが確認できました。)
28
28