質問編集履歴

1

Nginxの情報を追記しました

2019/12/05 02:13

投稿

lyzmfeqpxs54
lyzmfeqpxs54

スコア237

test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,199 @@
47
47
  Rails 5.2.3
48
48
 
49
49
  Ruby version: 2.6.1
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+ 追記
60
+
61
+ ```
62
+
63
+ # /etc/nginx/nginx.conf
64
+
65
+
66
+
67
+ user root;
68
+
69
+ worker_processes auto;
70
+
71
+ error_log /var/log/nginx/error.log;
72
+
73
+ pid /run/nginx.pid;
74
+
75
+
76
+
77
+ # Load dynamic modules. See /usr/share/nginx/README.dynamic.
78
+
79
+ include /usr/share/nginx/modules/*.conf;
80
+
81
+
82
+
83
+ events {
84
+
85
+ worker_connections 1024;
86
+
87
+ }
88
+
89
+
90
+
91
+ http {
92
+
93
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
94
+
95
+ '$status $body_bytes_sent "$http_referer" '
96
+
97
+ '"$http_user_agent" "$http_x_forwarded_for"';
98
+
99
+
100
+
101
+ proxy_cache_path /var/cache/nginx keys_zone=zone1:1m max_size=1g inactive=24h;
102
+
103
+ proxy_temp_path /var/cache/nginx_tmp;
104
+
105
+
106
+
107
+ access_log /var/log/nginx/access.log main;
108
+
109
+
110
+
111
+ sendfile on;
112
+
113
+ tcp_nopush on;
114
+
115
+ tcp_nodelay on;
116
+
117
+ keepalive_timeout 65;
118
+
119
+ types_hash_max_size 2048;
120
+
121
+
122
+
123
+ include /etc/nginx/mime.types;
124
+
125
+ default_type application/octet-stream;
126
+
127
+
128
+
129
+ include /etc/nginx/conf.d/*.conf;
130
+
131
+
132
+
133
+ server {
134
+
135
+ listen 80;
136
+
137
+ server_name ドメイン名.com;
138
+
139
+ root /home/rails/xxxxx/public;
140
+
141
+ include /etc/nginx/default.d/*.conf;
142
+
143
+
144
+
145
+ location / {
146
+
147
+ }
148
+
149
+
150
+
151
+ error_page 404 /404.html;
152
+
153
+ location = /40x.html {
154
+
155
+ }
156
+
157
+
158
+
159
+ access_log /var/log/xxxxx.access.log;
160
+
161
+ error_log /var/log/xxxxx.error.log;
162
+
163
+
164
+
165
+ error_page 500 502 503 504 /500.html;
166
+
167
+ location = /500.html {
168
+
169
+ root /home/rails/xxxxx/public;
170
+
171
+ }
172
+
173
+ }
174
+
175
+ }
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ # /etc/nginx/conf.d/ドメイン名.com.conf
184
+
185
+
186
+
187
+ upstream puma {
188
+
189
+ server unix:/home/rails/xxxxx/tmp/sockets/puma.sock fail_timeout=0;
190
+
191
+ }
192
+
193
+ server {
194
+
195
+ server_name ドメイン名.com;
196
+
197
+ listen 80;
198
+
199
+
200
+
201
+ try_files $uri/index.html $uri @puma;
202
+
203
+
204
+
205
+ location @puma {
206
+
207
+ proxy_read_timeout 300;
208
+
209
+ proxy_connect_timeout 300;
210
+
211
+ proxy_redirect off;
212
+
213
+ proxy_set_header Host $host;
214
+
215
+ proxy_set_header X-Forwarded-Proto $scheme;
216
+
217
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
218
+
219
+ proxy_pass http://puma;
220
+
221
+ }
222
+
223
+
224
+
225
+ access_log /var/log/xxxxx.access.log;
226
+
227
+ error_log /var/log/xxxxx.error.log;
228
+
229
+
230
+
231
+ error_page 500 502 503 504 /500.html;
232
+
233
+ client_max_body_size 4G;
234
+
235
+ large_client_header_buffers 4 256k;
236
+
237
+ keepalive_timeout 10;
238
+
239
+ }
240
+
241
+
242
+
243
+
244
+
245
+ ```