質問編集履歴

1

nginx.confの追加

2022/02/13 13:47

投稿

karun
karun

スコア18

test CHANGED
File without changes
test CHANGED
@@ -31,6 +31,106 @@
31
31
 
32
32
  AWS関連の情報が足りていない等ございましたら随時追加いたしますのでご指摘いただければ追記致しますのでよろしくお願い致します。
33
33
 
34
+ nginx.confになります。
34
35
 
36
+ ```
37
+ # For more information on configuration, see:
38
+ # * Official English Documentation: http://nginx.org/en/docs/
39
+ # * Official Russian Documentation: http://nginx.org/ru/docs/
35
40
 
41
+ user nginx;
42
+ worker_processes auto;
43
+ error_log /var/log/nginx/error.log;
44
+ pid /run/nginx.pid;
36
45
 
46
+ # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
47
+ include /usr/share/nginx/modules/*.conf;
48
+
49
+ events {
50
+ worker_connections 1024;
51
+ }
52
+
53
+ http {
54
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
55
+ '$status $body_bytes_sent "$http_referer" '
56
+ '"$http_user_agent" "$http_x_forwarded_for"';
57
+
58
+ access_log /var/log/nginx/access.log main;
59
+
60
+ sendfileon;
61
+ tcp_nopushon;
62
+ tcp_nodelayon;
63
+ keepalive_timeout 65;
64
+ types_hash_max_size 4096;
65
+
66
+ include/etc/nginx/mime.types;
67
+ default_typeapplication/octet-stream;
68
+
69
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
70
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
71
+ # for more information.
72
+ include /etc/nginx/conf.d/*.conf;
73
+ upstream app_server {
74
+ server 127.0.0.1:8000 fail_timeout=0;
75
+ }
76
+
77
+ server {
78
+ #listen 80;
79
+ #listen [::]:80;
80
+ #server_name _;
81
+ #root /usr/share/nginx/html;
82
+ #root /home/ec2-user/django/djangoApp;
83
+ listen 80;
84
+ server_name 18.177.35.81;
85
+ client_max_body_size 4G;
86
+
87
+ # Load configuration files for the default server block.
88
+ include /etc/nginx/default.d/*.conf;
89
+
90
+ location / {
91
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
92
+ proxy_set_header Host $http_host;
93
+ proxy_redirect off;
94
+ proxy_pass http://app_server;
95
+ }
96
+
97
+ error_page 404 /404.html;
98
+ location = /404.html {
99
+ }
100
+
101
+ error_page 500 502 503 504 /50x.html;
102
+ location = /50x.html {
103
+ }
104
+ }
105
+
106
+ # Settings for a TLS enabled server.
107
+ #
108
+ # server {
109
+ # listen 443 ssl http2;
110
+ # listen [::]:443 ssl http2;
111
+ # server_name _;
112
+ # root /usr/share/nginx/html;
113
+ #
114
+ # ssl_certificate "/etc/pki/nginx/server.crt";
115
+ # ssl_certificate_key "/etc/pki/nginx/private/server.key";
116
+ # ssl_session_cache shared:SSL:1m;
117
+ # ssl_session_timeout 10m;
118
+ # ssl_ciphers PROFILE=SYSTEM;
119
+ # ssl_prefer_server_ciphers on;
120
+ #
121
+ # # Load configuration files for the default server block.
122
+ # include /etc/nginx/default.d/*.conf;
123
+ #
124
+ # error_page 404 /404.html;
125
+ # location = /40x.html {
126
+ # }
127
+ #
128
+ # error_page 500 502 503 504 /50x.html;
129
+ # location = /50x.html {
130
+ # }
131
+ # }
132
+
133
+ }
134
+
135
+ ```
136
+