質問編集履歴
4
コメントアウトの表記
test
CHANGED
File without changes
|
test
CHANGED
@@ -142,11 +142,15 @@
|
|
142
142
|
|
143
143
|
|
144
144
|
|
145
|
+
///////////////////コメントアウト//////////////////
|
146
|
+
|
145
|
-
|
147
|
+
For more information on configuration, see:
|
146
|
-
|
148
|
+
|
147
|
-
|
149
|
+
* Official English Documentation: http://nginx.org/en/docs/
|
148
|
-
|
150
|
+
|
149
|
-
|
151
|
+
* Official Russian Documentation: http://nginx.org/ru/docs/
|
152
|
+
|
153
|
+
///////////////////コメントアウト//////////////////
|
150
154
|
|
151
155
|
|
152
156
|
|
@@ -160,7 +164,13 @@
|
|
160
164
|
|
161
165
|
|
162
166
|
|
167
|
+
///////////////////コメントアウト//////////////////
|
168
|
+
|
163
|
-
|
169
|
+
Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
|
170
|
+
|
171
|
+
///////////////////コメントアウト//////////////////
|
172
|
+
|
173
|
+
|
164
174
|
|
165
175
|
include /usr/share/nginx/modules/*.conf;
|
166
176
|
|
@@ -204,13 +214,19 @@
|
|
204
214
|
|
205
215
|
default_type application/octet-stream;
|
206
216
|
|
217
|
+
|
218
|
+
|
207
|
-
|
219
|
+
///////////////////コメントアウト//////////////////
|
208
|
-
|
220
|
+
|
209
|
-
|
221
|
+
Load modular configuration files from the /etc/nginx/conf.d directory.
|
210
|
-
|
222
|
+
|
211
|
-
|
223
|
+
See http://nginx.org/en/docs/ngx_core_module.html include
|
212
|
-
|
224
|
+
|
213
|
-
|
225
|
+
for more information.
|
226
|
+
|
227
|
+
///////////////////コメントアウト//////////////////
|
228
|
+
|
229
|
+
|
214
230
|
|
215
231
|
include /etc/nginx/conf.d/*.conf;
|
216
232
|
|
@@ -230,9 +246,15 @@
|
|
230
246
|
|
231
247
|
root /usr/share/nginx/html;
|
232
248
|
|
249
|
+
|
250
|
+
|
233
|
-
|
251
|
+
///////////////////コメントアウト//////////////////
|
234
|
-
|
252
|
+
|
235
|
-
|
253
|
+
Load configuration files for the default server block.
|
254
|
+
|
255
|
+
///////////////////コメントアウト//////////////////
|
256
|
+
|
257
|
+
|
236
258
|
|
237
259
|
include /etc/nginx/default.d/*.conf;
|
238
260
|
|
@@ -242,11 +264,13 @@
|
|
242
264
|
|
243
265
|
}
|
244
266
|
|
245
|
-
|
267
|
+
///////////////////コメントアウト//////////////////
|
246
|
-
|
268
|
+
|
247
|
-
|
269
|
+
redirect server error pages to the static page /40x.html
|
248
|
-
|
270
|
+
|
249
|
-
|
271
|
+
///////////////////コメントアウト//////////////////
|
272
|
+
|
273
|
+
|
250
274
|
|
251
275
|
error_page 404 /404.html;
|
252
276
|
|
@@ -256,9 +280,13 @@
|
|
256
280
|
|
257
281
|
|
258
282
|
|
283
|
+
///////////////////コメントアウト//////////////////
|
284
|
+
|
259
|
-
|
285
|
+
redirect server error pages to the static page /50x.html
|
260
|
-
|
286
|
+
|
261
|
-
|
287
|
+
///////////////////コメントアウト//////////////////
|
288
|
+
|
289
|
+
|
262
290
|
|
263
291
|
error_page 500 502 503 504 /50x.html;
|
264
292
|
|
@@ -268,117 +296,111 @@
|
|
268
296
|
|
269
297
|
|
270
298
|
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
# location = /50x.html {
|
378
|
-
|
379
|
-
# }
|
380
|
-
|
381
|
-
# }
|
299
|
+
///////////////////コメントアウト//////////////////
|
300
|
+
|
301
|
+
proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
302
|
+
|
303
|
+
location ~ .php$ {
|
304
|
+
|
305
|
+
proxy_pass http://127.0.0.1;
|
306
|
+
|
307
|
+
}
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
|
312
|
+
|
313
|
+
location ~ .php$ {
|
314
|
+
|
315
|
+
root html;
|
316
|
+
|
317
|
+
fastcgi_pass 127.0.0.1:9000;
|
318
|
+
|
319
|
+
fastcgi_index index.php;
|
320
|
+
|
321
|
+
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
|
322
|
+
|
323
|
+
include fastcgi_params;
|
324
|
+
|
325
|
+
}
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
deny access to .htaccess files, if Apache's document root
|
330
|
+
|
331
|
+
concurs with nginx's one
|
332
|
+
|
333
|
+
location ~ /.ht {
|
334
|
+
|
335
|
+
deny all;
|
336
|
+
|
337
|
+
}
|
338
|
+
|
339
|
+
///////////////////コメントアウト//////////////////
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
}
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
///////////////////コメントアウト//////////////////
|
348
|
+
|
349
|
+
Settings for a TLS enabled server.
|
350
|
+
|
351
|
+
server {
|
352
|
+
|
353
|
+
listen 443 ssl http2 default_server;
|
354
|
+
|
355
|
+
listen [::]:443 ssl http2 default_server;
|
356
|
+
|
357
|
+
server_name _;
|
358
|
+
|
359
|
+
root /usr/share/nginx/html;
|
360
|
+
|
361
|
+
ssl_certificate "/etc/pki/nginx/server.crt";
|
362
|
+
|
363
|
+
ssl_certificate_key "/etc/pki/nginx/private/server.key";
|
364
|
+
|
365
|
+
It is *strongly* recommended to generate unique DH parameters
|
366
|
+
|
367
|
+
Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
|
368
|
+
|
369
|
+
ssl_dhparam "/etc/pki/nginx/dhparams.pem";
|
370
|
+
|
371
|
+
ssl_session_cache shared:SSL:1m;
|
372
|
+
|
373
|
+
ssl_session_timeout 10m;
|
374
|
+
|
375
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
376
|
+
|
377
|
+
ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
|
378
|
+
|
379
|
+
ssl_prefer_server_ciphers on;
|
380
|
+
|
381
|
+
Load configuration files for the default server block.
|
382
|
+
|
383
|
+
include /etc/nginx/default.d/*.conf;
|
384
|
+
|
385
|
+
location / {
|
386
|
+
|
387
|
+
}
|
388
|
+
|
389
|
+
error_page 404 /404.html;
|
390
|
+
|
391
|
+
location = /40x.html {
|
392
|
+
|
393
|
+
}
|
394
|
+
|
395
|
+
error_page 500 502 503 504 /50x.html;
|
396
|
+
|
397
|
+
location = /50x.html {
|
398
|
+
|
399
|
+
}
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
///////////////////コメントアウト//////////////////
|
382
404
|
|
383
405
|
|
384
406
|
|
3
コメントアウト入力
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
書き替え
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,10 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
追記です。
|
22
|
+
|
23
|
+
|
24
|
+
|
21
25
|
大変申し訳ありません。
|
22
26
|
|
23
27
|
改行したものを追記いたします。
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,3 +13,383 @@
|
|
13
13
|
ちなみにproduction.logのエラーコードはこのような感じです。
|
14
14
|
|
15
15
|
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
大変申し訳ありません。
|
22
|
+
|
23
|
+
改行したものを追記いたします。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
以下同じ内容です。
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
ご覧いただきまして、ありがとうございます。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
説明不足で申し訳ございません。
|
36
|
+
|
37
|
+
セキュリティグループや各種設定は問題ないと存じます。
|
38
|
+
|
39
|
+
現状はポート80の時にCSSとjsが反映されない状況です。
|
40
|
+
|
41
|
+
3000番ポートの時はcssやjsも正常に表示されます。
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
先日までポート80でもきちんとCSSが反映されておりましたが、unicornの設定の不具合で色々と作業を行ううちに、反映されなくなってしまいました。
|
46
|
+
|
47
|
+
おそらくnginxが導入されていない状態なのかと思うのですが、実際はインストールされております。
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
nginxを認識させるために試したこと:
|
52
|
+
|
53
|
+
sudo service nginx stop
|
54
|
+
|
55
|
+
sudo service nginx start
|
56
|
+
|
57
|
+
sudo yum remove nginx
|
58
|
+
|
59
|
+
sudo yum install nginx
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
現状のnginxの設定ファイルは以下の通りです。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
●/etc/nginx/conf.d/app.conf
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
upstream app_server{
|
74
|
+
|
75
|
+
server 127.0.0.1:3000;
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
server {
|
82
|
+
|
83
|
+
listen 80;
|
84
|
+
|
85
|
+
server_name xxx.xxx.xxx.xxx;
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
root /var/www/my_app/public;
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
location ^~ /assets/ {
|
96
|
+
|
97
|
+
gzip_static on;
|
98
|
+
|
99
|
+
expires max;
|
100
|
+
|
101
|
+
add_header Cache-Control public;
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
try_files $uri/index.html $uri @unicorn;
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
location @unicorn {
|
112
|
+
|
113
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
114
|
+
|
115
|
+
proxy_set_header Host $http_host;
|
116
|
+
|
117
|
+
proxy_redirect off;
|
118
|
+
|
119
|
+
proxy_pass http://app_server;
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
error_page 500 502 503 504 /500.html;
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
●/etc/nginx/nginx.conf
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
# For more information on configuration, see:
|
142
|
+
|
143
|
+
# * Official English Documentation: http://nginx.org/en/docs/
|
144
|
+
|
145
|
+
# * Official Russian Documentation: http://nginx.org/ru/docs/
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
user nginx;
|
150
|
+
|
151
|
+
worker_processes auto;
|
152
|
+
|
153
|
+
error_log /var/log/nginx/error.log;
|
154
|
+
|
155
|
+
pid /var/run/nginx.pid;
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
|
160
|
+
|
161
|
+
include /usr/share/nginx/modules/*.conf;
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
events {
|
166
|
+
|
167
|
+
worker_connections 1024;
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
http {
|
174
|
+
|
175
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
176
|
+
|
177
|
+
'$status $body_bytes_sent "$http_referer" '
|
178
|
+
|
179
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
access_log /var/log/nginx/access.log main;
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
sendfile on;
|
188
|
+
|
189
|
+
tcp_nopush on;
|
190
|
+
|
191
|
+
tcp_nodelay on;
|
192
|
+
|
193
|
+
keepalive_timeout 65;
|
194
|
+
|
195
|
+
types_hash_max_size 2048;
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
include /etc/nginx/mime.types;
|
200
|
+
|
201
|
+
default_type application/octet-stream;
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
# Load modular configuration files from the /etc/nginx/conf.d directory.
|
206
|
+
|
207
|
+
# See http://nginx.org/en/docs/ngx_core_module.html#include
|
208
|
+
|
209
|
+
# for more information.
|
210
|
+
|
211
|
+
include /etc/nginx/conf.d/*.conf;
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
index index.html index.htm;
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
server {
|
220
|
+
|
221
|
+
listen 80 default_server;
|
222
|
+
|
223
|
+
listen [::]:80 default_server;
|
224
|
+
|
225
|
+
server_name localhost;
|
226
|
+
|
227
|
+
root /usr/share/nginx/html;
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
# Load configuration files for the default server block.
|
232
|
+
|
233
|
+
include /etc/nginx/default.d/*.conf;
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
location / {
|
238
|
+
|
239
|
+
}
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
# redirect server error pages to the static page /40x.html
|
244
|
+
|
245
|
+
#
|
246
|
+
|
247
|
+
error_page 404 /404.html;
|
248
|
+
|
249
|
+
location = /40x.html {
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
# redirect server error pages to the static page /50x.html
|
256
|
+
|
257
|
+
#
|
258
|
+
|
259
|
+
error_page 500 502 503 504 /50x.html;
|
260
|
+
|
261
|
+
location = /50x.html {
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
268
|
+
|
269
|
+
#
|
270
|
+
|
271
|
+
#location ~ .php$ {
|
272
|
+
|
273
|
+
# proxy_pass http://127.0.0.1;
|
274
|
+
|
275
|
+
#}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
|
280
|
+
|
281
|
+
#
|
282
|
+
|
283
|
+
#location ~ .php$ {
|
284
|
+
|
285
|
+
# root html;
|
286
|
+
|
287
|
+
# fastcgi_pass 127.0.0.1:9000;
|
288
|
+
|
289
|
+
# fastcgi_index index.php;
|
290
|
+
|
291
|
+
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
|
292
|
+
|
293
|
+
# include fastcgi_params;
|
294
|
+
|
295
|
+
#}
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
# deny access to .htaccess files, if Apache's document root
|
300
|
+
|
301
|
+
# concurs with nginx's one
|
302
|
+
|
303
|
+
#
|
304
|
+
|
305
|
+
#location ~ /.ht {
|
306
|
+
|
307
|
+
# deny all;
|
308
|
+
|
309
|
+
#}
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
# Settings for a TLS enabled server.
|
314
|
+
|
315
|
+
#
|
316
|
+
|
317
|
+
# server {
|
318
|
+
|
319
|
+
# listen 443 ssl http2 default_server;
|
320
|
+
|
321
|
+
# listen [::]:443 ssl http2 default_server;
|
322
|
+
|
323
|
+
# server_name _;
|
324
|
+
|
325
|
+
# root /usr/share/nginx/html;
|
326
|
+
|
327
|
+
#
|
328
|
+
|
329
|
+
# ssl_certificate "/etc/pki/nginx/server.crt";
|
330
|
+
|
331
|
+
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
|
332
|
+
|
333
|
+
# # It is *strongly* recommended to generate unique DH parameters
|
334
|
+
|
335
|
+
# # Generate them with: openssl dhparam -out /etc/pki/nginx/dhparams.pem 2048
|
336
|
+
|
337
|
+
# #ssl_dhparam "/etc/pki/nginx/dhparams.pem";
|
338
|
+
|
339
|
+
# ssl_session_cache shared:SSL:1m;
|
340
|
+
|
341
|
+
# ssl_session_timeout 10m;
|
342
|
+
|
343
|
+
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
344
|
+
|
345
|
+
# ssl_ciphers HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP;
|
346
|
+
|
347
|
+
# ssl_prefer_server_ciphers on;
|
348
|
+
|
349
|
+
#
|
350
|
+
|
351
|
+
# # Load configuration files for the default server block.
|
352
|
+
|
353
|
+
# include /etc/nginx/default.d/*.conf;
|
354
|
+
|
355
|
+
#
|
356
|
+
|
357
|
+
# location / {
|
358
|
+
|
359
|
+
# }
|
360
|
+
|
361
|
+
#
|
362
|
+
|
363
|
+
# error_page 404 /404.html;
|
364
|
+
|
365
|
+
# location = /40x.html {
|
366
|
+
|
367
|
+
# }
|
368
|
+
|
369
|
+
#
|
370
|
+
|
371
|
+
# error_page 500 502 503 504 /50x.html;
|
372
|
+
|
373
|
+
# location = /50x.html {
|
374
|
+
|
375
|
+
# }
|
376
|
+
|
377
|
+
# }
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
}
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
nginxはアンインストール後にインストールし直しましたが、conf.d/nginx.confはアンインストール前の記述が残っておりました。
|
386
|
+
|
387
|
+
アンインストールする場合は、confファイルも別にrmで削除したほうが良いのでしょうか。
|
388
|
+
|
389
|
+
nginxのファイルがどのディレクトリにどのように入っているのかわからず、上記のようにいたしました。
|
390
|
+
|
391
|
+
何かお気付きになる点などがございましたら、ぜひご教授くださいませ。
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
よろしくお願いいたします。
|