質問編集履歴

12

訂正

2017/09/17 01:39

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- `[asobi](/var/www/projects/offisee) $ sudo cat /etc/nginx/conf.d/offisee.conf`
9
+ `[user](/var/www/projects/***) $ sudo cat /etc/nginx/conf.d/***.conf`
10
10
 
11
11
 
12
12
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  upstream unicorn_server {
18
18
 
19
- server unix:/var/www/projects/offisee/tmp/sockets/.unicorn.sock
19
+ server unix:/var/www/projects/***/tmp/sockets/.unicorn.sock
20
20
 
21
21
  fail_timeout=0;
22
22
 
@@ -40,13 +40,13 @@
40
40
 
41
41
  # Location of our static files
42
42
 
43
- root /var/www/projects/offisee/public;
43
+ root /var/www/projects/***/public;
44
44
 
45
45
 
46
46
 
47
47
  location ~ ^/assets/ {
48
48
 
49
- root /var/www/projects/offisee/public;
49
+ root /var/www/projects/***/public;
50
50
 
51
51
  }
52
52
 
@@ -78,7 +78,7 @@
78
78
 
79
79
  location = /500.html {
80
80
 
81
- root /var/www/projects/offisee/public;
81
+ root /var/www/projects/***/public;
82
82
 
83
83
  }
84
84
 
@@ -90,7 +90,7 @@
90
90
 
91
91
 
92
92
 
93
- `[asobi](/var/www/projects/offisee) $ cat config/unicorn.conf.rb`
93
+ `[user](/var/www/projects/***) $ cat config/unicorn.conf.rb`
94
94
 
95
95
 
96
96
 
@@ -104,7 +104,7 @@
104
104
 
105
105
  $timeout = 30
106
106
 
107
- $app_dir = "/var/www/projects/offisee"
107
+ $app_dir = "/var/www/projects/***"
108
108
 
109
109
  $listen = File.expand_path 'tmp/sockets/.unicorn.sock', $app_dir
110
110
 

11

nginxとunicorn設定ファイル

2017/09/17 01:39

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -6,15 +6,7 @@
6
6
 
7
7
 
8
8
 
9
-
10
-
11
- # エラーログ
12
-
13
-
14
-
15
- `nginx`のエラーログ
16
-
17
- `$ sudo tail -f /var/log/nginx/error.log`
9
+ `[asobi](/var/www/projects/offisee) $ sudo cat /etc/nginx/conf.d/offisee.conf`
18
10
 
19
11
 
20
12
 
@@ -22,17 +14,75 @@
22
14
 
23
15
 
24
16
 
25
- [error] 2913#0: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 125.0.109.71,server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "52.199.206.175", referrer: "http://52.199.206.175/"
17
+ upstream unicorn_server {
26
18
 
27
- [crit] 29690#0: *1 connect() to unix:/var/www/projects/offisee/tmp/sockets/.unicorn.sock failed (2: No such file or directory) while connecting to upstream, client: 125.0.109.71, server: 52.199.206.175, request: "GET / HTTP/1.1", upstream: "http://unix:/var/www/projects/offisee/tmp/sockets/.unicorn.sock:/", host: "52.199.206.175"
19
+ server unix:/var/www/projects/offisee/tmp/sockets/.unicorn.sock
28
20
 
29
- [alert] 30160#0: *1 open socket #3 left in connection 3
21
+ fail_timeout=0;
30
22
 
31
- [alert] 30160#0: *2 open socket #12 left in connection 4
23
+ }
32
24
 
33
- [alert] 30160#0: aborting
34
25
 
35
- [error] 2793#0: *583 open() "/usr/share/nginx/html/azenv.php" failed (2: No such file or directory), client: 10.0.0.206, server: localhost, request: "POST /azenv.php?auth=150231231239&a=PSCMN&i=885413847&p=80 HTTP/1.1", host: "check.proxyradar.com", referrer: "https://proxyradar.com/"
26
+
27
+ server {
28
+
29
+ listen 80;
30
+
31
+ client_max_body_size 4G;
32
+
33
+ server_name 54.65.226.96;
34
+
35
+
36
+
37
+ keepalive_timeout 5;
38
+
39
+
40
+
41
+ # Location of our static files
42
+
43
+ root /var/www/projects/offisee/public;
44
+
45
+
46
+
47
+ location ~ ^/assets/ {
48
+
49
+ root /var/www/projects/offisee/public;
50
+
51
+ }
52
+
53
+
54
+
55
+ location / {
56
+
57
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58
+
59
+ proxy_set_header Host $http_host;
60
+
61
+ proxy_redirect off;
62
+
63
+
64
+
65
+ if (!-f $request_filename) {
66
+
67
+ proxy_pass http://unicorn_server;
68
+
69
+ break;
70
+
71
+ }
72
+
73
+ }
74
+
75
+
76
+
77
+ error_page 500 502 503 504 /500.html;
78
+
79
+ location = /500.html {
80
+
81
+ root /var/www/projects/offisee/public;
82
+
83
+ }
84
+
85
+ }
36
86
 
37
87
 
38
88
 
@@ -40,157 +90,7 @@
40
90
 
41
91
 
42
92
 
43
- `unicorn`のログで気になる部分は、
44
-
45
- `$ cat {アプリ}/log/unicorn.log`
46
-
47
-
48
-
49
- ```
50
-
51
-
52
-
53
- unlinking existing socket=/var/www/projects/offisee/tmp/sockets/.unicorn.sock
54
-
55
- listening on addr=/var/www/projects/offisee/tmp/sockets/.unicorn.sock fd=11
56
-
57
-
58
-
59
- ```
60
-
61
-
62
-
63
-
64
-
65
- `nginx`の設定ファイル
66
-
67
-
68
-
69
- ```
70
-
71
-
72
-
73
- [/etc/nginx] $ ls
74
-
75
- conf.d fastcgi.conf fastcgi_params koi-utf mime.types nginx.conf scgi_params uwsgi_params win-utf
76
-
77
- default.d fastcgi.conf.default fastcgi_params.default koi-win mime.types.default nginx.conf.default scgi_params.default uwsgi_params.default
78
-
79
-
80
-
81
- [/etc/nginx/conf.d] $ ls
82
-
83
- アプリ名.conf virtual.conf
84
-
85
-
86
-
87
- この部分のみ新規編集しています。
88
-
89
-
90
-
91
- ```
92
-
93
-
94
-
95
- # 設定ファイル
96
-
97
-
98
-
99
- `/etc/nginx/conf.d/{アプリ名}.conf`
100
-
101
-
102
-
103
- ```
104
-
105
-
106
-
107
-
108
-
109
- upstream unicorn_server {
110
-
111
- server unix:/var/www/projects/offisee/tmp/sockets/.unicorn.sock
93
+ `[asobi](/var/www/projects/offisee) $ cat config/unicorn.conf.rb`
112
-
113
- fail_timeout=0;
114
-
115
- }
116
-
117
-
118
-
119
- server {
120
-
121
- listen 80;
122
-
123
- client_max_body_size 4G;
124
-
125
- server_name 54.65.226.96;
126
-
127
-
128
-
129
- keepalive_timeout 5;
130
-
131
-
132
-
133
- # Location of our static files
134
-
135
- root /var/www/projects/offisee/public;
136
-
137
-
138
-
139
- location ~ ^/assets/ {
140
-
141
- root /var/www/projects/offisee/public;
142
-
143
- }
144
-
145
-
146
-
147
- location / {
148
-
149
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
150
-
151
- proxy_set_header Host $http_host;
152
-
153
- proxy_redirect off;
154
-
155
-
156
-
157
- if (!-f $request_filename) {
158
-
159
- proxy_pass http://unicorn_server;
160
-
161
- break;
162
-
163
- }
164
-
165
- }
166
-
167
-
168
-
169
- error_page 500 502 503 504 /500.html;
170
-
171
- location = /500.html {
172
-
173
- root /var/www/projects/offisee/public;
174
-
175
- }
176
-
177
- }
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
- ```
188
-
189
-
190
-
191
-
192
-
193
- `{アプリ名}/config/unicorn.conf.rb`
194
94
 
195
95
 
196
96
 
@@ -264,404 +164,4 @@
264
164
 
265
165
 
266
166
 
267
-
268
-
269
167
  ```
270
-
271
-
272
-
273
- # お願い
274
-
275
-
276
-
277
- `error`のログを見て、何か思い当たる点があるかた、
278
-
279
- ぜひ教えていただけないでしょうか。
280
-
281
- 現在は`IPアドレス`にアクセスしてもサーバーが応答しない状態です。
282
-
283
-
284
-
285
- # 追伸(nginx.confとnginx.conf.defaultの状態)
286
-
287
- 以下2つは編集を行っておらず、デフォルトのままです。
288
-
289
- 文字数の関係で設定例コメントアウト箇所を一部省略しました。
290
-
291
-
292
-
293
- `nginx.conf`
294
-
295
-
296
-
297
- ```
298
-
299
-
300
-
301
- # For more information on configuration, see:
302
-
303
- # * Official English Documentation: http://nginx.org/en/docs/
304
-
305
- # * Official Russian Documentation: http://nginx.org/ru/docs/
306
-
307
-
308
-
309
- user nginx;
310
-
311
- worker_processes auto;
312
-
313
- error_log /var/log/nginx/error.log;
314
-
315
- pid /var/run/nginx.pid;
316
-
317
-
318
-
319
- # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
320
-
321
- include /usr/share/nginx/modules/*.conf;
322
-
323
-
324
-
325
- events {
326
-
327
- worker_connections 1024;
328
-
329
- }
330
-
331
-
332
-
333
- http {
334
-
335
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
336
-
337
- '$status $body_bytes_sent "$http_referer" '
338
-
339
- '"$http_user_agent" "$http_x_forwarded_for"';
340
-
341
-
342
-
343
- access_log /var/log/nginx/access.log main;
344
-
345
-
346
-
347
- sendfile on;
348
-
349
- tcp_nopush on;
350
-
351
- tcp_nodelay on;
352
-
353
- keepalive_timeout 65;
354
-
355
- types_hash_max_size 2048;
356
-
357
-
358
-
359
- include /etc/nginx/mime.types;
360
-
361
- default_type application/octet-stream;
362
-
363
-
364
-
365
- # Load modular configuration files from the /etc/nginx/conf.d directory.
366
-
367
- # See http://nginx.org/en/docs/ngx_core_module.html#include
368
-
369
- # for more information.
370
-
371
- include /etc/nginx/conf.d/*.conf;
372
-
373
-
374
-
375
- index index.html index.htm;
376
-
377
-
378
-
379
- server {
380
-
381
- listen 80 default_server;
382
-
383
- listen [::]:80 default_server;
384
-
385
- server_name localhost;
386
-
387
- root /usr/share/nginx/html;
388
-
389
-
390
-
391
-
392
-
393
- # Load configuration files for the default server block.
394
-
395
- include /etc/nginx/default.d/*.conf;
396
-
397
-
398
-
399
- location / {
400
-
401
- }
402
-
403
-
404
-
405
- # redirect server error pages to the static page /40x.html
406
-
407
- #
408
-
409
- error_page 404 /404.html;
410
-
411
- location = /40x.html {
412
-
413
- }
414
-
415
-
416
-
417
- # redirect server error pages to the static page /50x.html
418
-
419
- #
420
-
421
- error_page 500 502 503 504 /50x.html;
422
-
423
- location = /50x.html {
424
-
425
- }
426
-
427
-
428
-
429
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
430
-
431
- #
432
-
433
- #location ~ \.php$ {
434
-
435
- # proxy_pass http://127.0.0.1;
436
-
437
- #}
438
-
439
-
440
-
441
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
442
-
443
- #
444
-
445
- #location ~ \.php$ {
446
-
447
- # root html;
448
-
449
- # fastcgi_pass 127.0.0.1:9000;
450
-
451
- # fastcgi_index index.php;
452
-
453
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
454
-
455
- # include fastcgi_params;
456
-
457
- #}
458
-
459
-
460
-
461
- # deny access to .htaccess files, if Apache's document root
462
-
463
- # concurs with nginx's one
464
-
465
- #
466
-
467
- #location ~ /\.ht {
468
-
469
- # deny all;
470
-
471
- #}
472
-
473
- }
474
-
475
-
476
-
477
- }
478
-
479
-
480
-
481
-
482
-
483
- ```
484
-
485
-
486
-
487
- `nginx.conf.default`
488
-
489
-
490
-
491
- ```
492
-
493
-
494
-
495
- #user nobody;
496
-
497
- worker_processes 1;
498
-
499
-
500
-
501
- #error_log logs/error.log;
502
-
503
- #error_log logs/error.log notice;
504
-
505
- #error_log logs/error.log info;
506
-
507
-
508
-
509
- #pid logs/nginx.pid;
510
-
511
-
512
-
513
-
514
-
515
- events {
516
-
517
- worker_connections 1024;
518
-
519
- }
520
-
521
-
522
-
523
-
524
-
525
- http {
526
-
527
- include mime.types;
528
-
529
- default_type application/octet-stream;
530
-
531
-
532
-
533
- #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
534
-
535
- # '$status $body_bytes_sent "$http_referer" '
536
-
537
- # '"$http_user_agent" "$http_x_forwarded_for"';
538
-
539
-
540
-
541
- #access_log logs/access.log main;
542
-
543
-
544
-
545
- sendfile on;
546
-
547
- #tcp_nopush on;
548
-
549
-
550
-
551
- #keepalive_timeout 0;
552
-
553
- keepalive_timeout 65;
554
-
555
-
556
-
557
- #gzip on;
558
-
559
-
560
-
561
- server {
562
-
563
- listen 80;
564
-
565
- server_name localhost;
566
-
567
-
568
-
569
- #charset koi8-r;
570
-
571
-
572
-
573
- #access_log logs/host.access.log main;
574
-
575
-
576
-
577
- location / {
578
-
579
- root html;
580
-
581
- index index.html index.htm;
582
-
583
- }
584
-
585
-
586
-
587
- #error_page 404 /404.html;
588
-
589
-
590
-
591
- # redirect server error pages to the static page /50x.html
592
-
593
- #
594
-
595
- error_page 500 502 503 504 /50x.html;
596
-
597
- location = /50x.html {
598
-
599
- root html;
600
-
601
- }
602
-
603
-
604
-
605
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
606
-
607
- #
608
-
609
- #location ~ \.php$ {
610
-
611
- # proxy_pass http://127.0.0.1;
612
-
613
- #}
614
-
615
-
616
-
617
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
618
-
619
- #
620
-
621
- #location ~ \.php$ {
622
-
623
- # root html;
624
-
625
- # fastcgi_pass 127.0.0.1:9000;
626
-
627
- # fastcgi_index index.php;
628
-
629
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
630
-
631
- # include fastcgi_params;
632
-
633
- #}
634
-
635
-
636
-
637
- # deny access to .htaccess files, if Apache's document root
638
-
639
- # concurs with nginx's one
640
-
641
- #
642
-
643
- #location ~ /\.ht {
644
-
645
- # deny all;
646
-
647
- #}
648
-
649
- }
650
-
651
-
652
-
653
- }
654
-
655
-
656
-
657
-
658
-
659
- ```
660
-
661
-
662
-
663
- # 追伸
664
-
665
-
666
-
667
- ![![イメージ説明](4712643384c05391416fb8080cfda800.png)](9bd9504794b4eea3a0668aa57d07b655.png)

10

ロードバランザー

2017/08/10 15:36

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -657,3 +657,11 @@
657
657
 
658
658
 
659
659
  ```
660
+
661
+
662
+
663
+ # 追伸
664
+
665
+
666
+
667
+ ![![イメージ説明](4712643384c05391416fb8080cfda800.png)](9bd9504794b4eea3a0668aa57d07b655.png)

9

IPアドレスを変えました。

2017/08/10 15:20

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -122,7 +122,7 @@
122
122
 
123
123
  client_max_body_size 4G;
124
124
 
125
- server_name 52.199.206.175;
125
+ server_name 54.65.226.96;
126
126
 
127
127
 
128
128
 

8

はあ

2017/08/10 14:36

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -657,39 +657,3 @@
657
657
 
658
658
 
659
659
  ```
660
-
661
-
662
-
663
- # 追伸
664
-
665
-
666
-
667
- ```
668
-
669
- norito 4009 1 0 03:15 ? 00:00:01 unicorn_rails master -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
670
-
671
- norito 4012 4009 0 03:15 ? 00:00:00 unicorn_rails worker[0] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
672
-
673
- norito 4014 4009 0 03:15 ? 00:00:00 unicorn_rails worker[1] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
674
-
675
- ```
676
-
677
-
678
-
679
- # 追伸2
680
-
681
-
682
-
683
- ![イメージ説明](2055382436d1331fed93c2e6d2ea2b5e.png)
684
-
685
-
686
-
687
- # 追伸3
688
-
689
- ![イメージ説明](bfa66f4cbe57472b823e3ba4a84e6ea6.png)
690
-
691
-
692
-
693
- # 追伸4
694
-
695
- ![イメージ説明](e0c1c0eda08690f4bd6490f6a2c50145.png)

7

it work

2017/08/10 09:52

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -687,3 +687,9 @@
687
687
  # 追伸3
688
688
 
689
689
  ![イメージ説明](bfa66f4cbe57472b823e3ba4a84e6ea6.png)
690
+
691
+
692
+
693
+ # 追伸4
694
+
695
+ ![イメージ説明](e0c1c0eda08690f4bd6490f6a2c50145.png)

6

nginx

2017/08/10 05:31

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -681,3 +681,9 @@
681
681
 
682
682
 
683
683
  ![イメージ説明](2055382436d1331fed93c2e6d2ea2b5e.png)
684
+
685
+
686
+
687
+ # 追伸3
688
+
689
+ ![イメージ説明](bfa66f4cbe57472b823e3ba4a84e6ea6.png)

5

アクセス権

2017/08/10 05:21

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -673,3 +673,11 @@
673
673
  norito 4014 4009 0 03:15 ? 00:00:00 unicorn_rails worker[1] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
674
674
 
675
675
  ```
676
+
677
+
678
+
679
+ # 追伸2
680
+
681
+
682
+
683
+ ![イメージ説明](2055382436d1331fed93c2e6d2ea2b5e.png)

4

ユーザ名を入力

2017/08/10 05:14

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -666,10 +666,10 @@
666
666
 
667
667
  ```
668
668
 
669
- {ユーザ名} 4009 1 0 03:15 ? 00:00:01 unicorn_rails master -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
669
+ norito 4009 1 0 03:15 ? 00:00:01 unicorn_rails master -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
670
-
670
+
671
- {ユーザ名} 4012 4009 0 03:15 ? 00:00:00 unicorn_rails worker[0] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
671
+ norito 4012 4009 0 03:15 ? 00:00:00 unicorn_rails worker[0] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
672
-
672
+
673
- {ユーザ名} 4014 4009 0 03:15 ? 00:00:00 unicorn_rails worker[1] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
673
+ norito 4014 4009 0 03:15 ? 00:00:00 unicorn_rails worker[1] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
674
-
674
+
675
- ```
675
+ ```

3

unicornのプロセスを追加

2017/08/10 05:02

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -657,3 +657,19 @@
657
657
 
658
658
 
659
659
  ```
660
+
661
+
662
+
663
+ # 追伸
664
+
665
+
666
+
667
+ ```
668
+
669
+ {ユーザ名} 4009 1 0 03:15 ? 00:00:01 unicorn_rails master -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
670
+
671
+ {ユーザ名} 4012 4009 0 03:15 ? 00:00:00 unicorn_rails worker[0] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
672
+
673
+ {ユーザ名} 4014 4009 0 03:15 ? 00:00:00 unicorn_rails worker[1] -c /var/www/projects/offisee/config/unicorn.conf.rb -D -E production
674
+
675
+ ```

2

誤字脱字

2017/08/10 04:53

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -282,21 +282,11 @@
282
282
 
283
283
 
284
284
 
285
-
286
-
287
285
  # 追伸(nginx.confとnginx.conf.defaultの状態)
288
286
 
289
-
290
-
291
287
  以下2つは編集を行っておらず、デフォルトのままです。
292
288
 
293
-
294
-
295
- # 追伸(nginx.confとnginx.conf.defaultの状態)
296
-
297
- 以下2つは編集を行っておらず、デフォルトのままです。
298
-
299
- 文字数の関係でコメントアウトの部分を一部省略しました。
289
+ 文字数の関係で設定例コメントアウト箇所を一部省略しました。
300
290
 
301
291
 
302
292
 

1

修正

2017/08/10 00:00

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -279,3 +279,391 @@
279
279
  ぜひ教えていただけないでしょうか。
280
280
 
281
281
  現在は`IPアドレス`にアクセスしてもサーバーが応答しない状態です。
282
+
283
+
284
+
285
+
286
+
287
+ # 追伸(nginx.confとnginx.conf.defaultの状態)
288
+
289
+
290
+
291
+ 以下2つは編集を行っておらず、デフォルトのままです。
292
+
293
+
294
+
295
+ # 追伸(nginx.confとnginx.conf.defaultの状態)
296
+
297
+ 以下2つは編集を行っておらず、デフォルトのままです。
298
+
299
+ 文字数の関係でコメントアウトの部分を一部省略しました。
300
+
301
+
302
+
303
+ `nginx.conf`
304
+
305
+
306
+
307
+ ```
308
+
309
+
310
+
311
+ # For more information on configuration, see:
312
+
313
+ # * Official English Documentation: http://nginx.org/en/docs/
314
+
315
+ # * Official Russian Documentation: http://nginx.org/ru/docs/
316
+
317
+
318
+
319
+ user nginx;
320
+
321
+ worker_processes auto;
322
+
323
+ error_log /var/log/nginx/error.log;
324
+
325
+ pid /var/run/nginx.pid;
326
+
327
+
328
+
329
+ # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
330
+
331
+ include /usr/share/nginx/modules/*.conf;
332
+
333
+
334
+
335
+ events {
336
+
337
+ worker_connections 1024;
338
+
339
+ }
340
+
341
+
342
+
343
+ http {
344
+
345
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
346
+
347
+ '$status $body_bytes_sent "$http_referer" '
348
+
349
+ '"$http_user_agent" "$http_x_forwarded_for"';
350
+
351
+
352
+
353
+ access_log /var/log/nginx/access.log main;
354
+
355
+
356
+
357
+ sendfile on;
358
+
359
+ tcp_nopush on;
360
+
361
+ tcp_nodelay on;
362
+
363
+ keepalive_timeout 65;
364
+
365
+ types_hash_max_size 2048;
366
+
367
+
368
+
369
+ include /etc/nginx/mime.types;
370
+
371
+ default_type application/octet-stream;
372
+
373
+
374
+
375
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
376
+
377
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
378
+
379
+ # for more information.
380
+
381
+ include /etc/nginx/conf.d/*.conf;
382
+
383
+
384
+
385
+ index index.html index.htm;
386
+
387
+
388
+
389
+ server {
390
+
391
+ listen 80 default_server;
392
+
393
+ listen [::]:80 default_server;
394
+
395
+ server_name localhost;
396
+
397
+ root /usr/share/nginx/html;
398
+
399
+
400
+
401
+
402
+
403
+ # Load configuration files for the default server block.
404
+
405
+ include /etc/nginx/default.d/*.conf;
406
+
407
+
408
+
409
+ location / {
410
+
411
+ }
412
+
413
+
414
+
415
+ # redirect server error pages to the static page /40x.html
416
+
417
+ #
418
+
419
+ error_page 404 /404.html;
420
+
421
+ location = /40x.html {
422
+
423
+ }
424
+
425
+
426
+
427
+ # redirect server error pages to the static page /50x.html
428
+
429
+ #
430
+
431
+ error_page 500 502 503 504 /50x.html;
432
+
433
+ location = /50x.html {
434
+
435
+ }
436
+
437
+
438
+
439
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
440
+
441
+ #
442
+
443
+ #location ~ \.php$ {
444
+
445
+ # proxy_pass http://127.0.0.1;
446
+
447
+ #}
448
+
449
+
450
+
451
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
452
+
453
+ #
454
+
455
+ #location ~ \.php$ {
456
+
457
+ # root html;
458
+
459
+ # fastcgi_pass 127.0.0.1:9000;
460
+
461
+ # fastcgi_index index.php;
462
+
463
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
464
+
465
+ # include fastcgi_params;
466
+
467
+ #}
468
+
469
+
470
+
471
+ # deny access to .htaccess files, if Apache's document root
472
+
473
+ # concurs with nginx's one
474
+
475
+ #
476
+
477
+ #location ~ /\.ht {
478
+
479
+ # deny all;
480
+
481
+ #}
482
+
483
+ }
484
+
485
+
486
+
487
+ }
488
+
489
+
490
+
491
+
492
+
493
+ ```
494
+
495
+
496
+
497
+ `nginx.conf.default`
498
+
499
+
500
+
501
+ ```
502
+
503
+
504
+
505
+ #user nobody;
506
+
507
+ worker_processes 1;
508
+
509
+
510
+
511
+ #error_log logs/error.log;
512
+
513
+ #error_log logs/error.log notice;
514
+
515
+ #error_log logs/error.log info;
516
+
517
+
518
+
519
+ #pid logs/nginx.pid;
520
+
521
+
522
+
523
+
524
+
525
+ events {
526
+
527
+ worker_connections 1024;
528
+
529
+ }
530
+
531
+
532
+
533
+
534
+
535
+ http {
536
+
537
+ include mime.types;
538
+
539
+ default_type application/octet-stream;
540
+
541
+
542
+
543
+ #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
544
+
545
+ # '$status $body_bytes_sent "$http_referer" '
546
+
547
+ # '"$http_user_agent" "$http_x_forwarded_for"';
548
+
549
+
550
+
551
+ #access_log logs/access.log main;
552
+
553
+
554
+
555
+ sendfile on;
556
+
557
+ #tcp_nopush on;
558
+
559
+
560
+
561
+ #keepalive_timeout 0;
562
+
563
+ keepalive_timeout 65;
564
+
565
+
566
+
567
+ #gzip on;
568
+
569
+
570
+
571
+ server {
572
+
573
+ listen 80;
574
+
575
+ server_name localhost;
576
+
577
+
578
+
579
+ #charset koi8-r;
580
+
581
+
582
+
583
+ #access_log logs/host.access.log main;
584
+
585
+
586
+
587
+ location / {
588
+
589
+ root html;
590
+
591
+ index index.html index.htm;
592
+
593
+ }
594
+
595
+
596
+
597
+ #error_page 404 /404.html;
598
+
599
+
600
+
601
+ # redirect server error pages to the static page /50x.html
602
+
603
+ #
604
+
605
+ error_page 500 502 503 504 /50x.html;
606
+
607
+ location = /50x.html {
608
+
609
+ root html;
610
+
611
+ }
612
+
613
+
614
+
615
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
616
+
617
+ #
618
+
619
+ #location ~ \.php$ {
620
+
621
+ # proxy_pass http://127.0.0.1;
622
+
623
+ #}
624
+
625
+
626
+
627
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
628
+
629
+ #
630
+
631
+ #location ~ \.php$ {
632
+
633
+ # root html;
634
+
635
+ # fastcgi_pass 127.0.0.1:9000;
636
+
637
+ # fastcgi_index index.php;
638
+
639
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
640
+
641
+ # include fastcgi_params;
642
+
643
+ #}
644
+
645
+
646
+
647
+ # deny access to .htaccess files, if Apache's document root
648
+
649
+ # concurs with nginx's one
650
+
651
+ #
652
+
653
+ #location ~ /\.ht {
654
+
655
+ # deny all;
656
+
657
+ #}
658
+
659
+ }
660
+
661
+
662
+
663
+ }
664
+
665
+
666
+
667
+
668
+
669
+ ```