質問編集履歴

2

追記

2017/01/20 01:53

投稿

qaz3330
qaz3330

スコア113

test CHANGED
File without changes
test CHANGED
@@ -165,3 +165,209 @@
165
165
  }
166
166
 
167
167
  ```
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ # 追記
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+ ```
184
+
185
+ ls -ll /etc/nginx/
186
+
187
+ total 80
188
+
189
+ drwxr-xr-x 2 root root 4096 Jan 20 10:18 conf.d
190
+
191
+ drwxr-xr-x 2 root root 4096 Aug 5 09:05 default.d
192
+
193
+ -rw-r--r-- 1 root root 1077 Aug 5 09:05 fastcgi.conf
194
+
195
+ -rw-r--r-- 1 root root 1077 Aug 5 09:05 fastcgi.conf.default
196
+
197
+ -rw-r--r-- 1 root root 1007 Aug 5 09:05 fastcgi_params
198
+
199
+ -rw-r--r-- 1 root root 1007 Aug 5 09:05 fastcgi_params.default
200
+
201
+ -rw-r--r-- 1 root root 2837 Aug 5 09:05 koi-utf
202
+
203
+ -rw-r--r-- 1 root root 2223 Aug 5 09:05 koi-win
204
+
205
+ -rw-r--r-- 1 root root 3957 Aug 5 09:05 mime.types
206
+
207
+ -rw-r--r-- 1 root root 3957 Aug 5 09:05 mime.types.default
208
+
209
+ -rw-r--r-- 1 root root 788 Jan 19 17:41 nginx.conf
210
+
211
+ -rw-r--r-- 1 root root 2656 Aug 5 09:05 nginx.conf.default
212
+
213
+ -rw-r--r-- 1 root root 636 Aug 5 09:05 scgi_params
214
+
215
+ -rw-r--r-- 1 root root 636 Aug 5 09:05 scgi_params.default
216
+
217
+ drwxr-xr-x 2 root root 4096 Jan 19 18:24 sites-available
218
+
219
+ drwxr-xr-x 2 root root 4096 Jan 19 18:24 sites-enabled
220
+
221
+ drw------- 2 root root 4096 Jan 19 18:24 ssl
222
+
223
+ -rw-r--r-- 1 root root 664 Aug 5 09:05 uwsgi_params
224
+
225
+ -rw-r--r-- 1 root root 664 Aug 5 09:05 uwsgi_params.default
226
+
227
+ -rw-r--r-- 1 root root 3610 Aug 5 09:05 win-utf
228
+
229
+ ```
230
+
231
+
232
+
233
+ ```
234
+
235
+ ls -ll /etc/nginx/conf.d/
236
+
237
+ total 4
238
+
239
+ -rw-r--r-- 1 root root 283 Aug 5 09:04 virtual.conf
240
+
241
+ ```
242
+
243
+
244
+
245
+ /etc/nginx/conf.d/virtual.conf
246
+
247
+
248
+
249
+ ```
250
+
251
+ #
252
+
253
+ # virtual host using mix of IP-, name-, and port-based configuration
254
+
255
+ #
256
+
257
+
258
+
259
+ #server {
260
+
261
+ # listen 8000;
262
+
263
+ # listen somename:8080;
264
+
265
+ # server_name somename alias another.alias;
266
+
267
+
268
+
269
+ # location / {
270
+
271
+ # root html;
272
+
273
+ # index index.html index.htm;
274
+
275
+ # }
276
+
277
+ #}
278
+
279
+ ```
280
+
281
+
282
+
283
+
284
+
285
+ /etc/nginx/sites-enabled/hoge_app
286
+
287
+
288
+
289
+ ```
290
+
291
+ listen 80;
292
+
293
+ server_name hoge_app rails-app;
294
+
295
+
296
+
297
+ access_log /var/log/nginx/hoge_app.access.log;
298
+
299
+
300
+
301
+ keepalive_timeout 5;
302
+
303
+
304
+
305
+ root /srv/www/hoge_app/current/public/;
306
+
307
+
308
+
309
+
310
+
311
+ location / {
312
+
313
+ try_files $uri/index.html $uri/index.htm @unicorn;
314
+
315
+ }
316
+
317
+
318
+
319
+ location @unicorn {
320
+
321
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
322
+
323
+ proxy_set_header Host $http_host;
324
+
325
+ proxy_redirect off;
326
+
327
+
328
+
329
+ proxy_read_timeout 60;
330
+
331
+ proxy_send_timeout 60;
332
+
333
+
334
+
335
+ # If you don't find the filename in the static files
336
+
337
+ # Then request it from the unicorn server
338
+
339
+ if (!-f $request_filename) {
340
+
341
+ proxy_pass http://unicorn_hoge_app;
342
+
343
+ break;
344
+
345
+ }
346
+
347
+ }
348
+
349
+
350
+
351
+ location /nginx_status {
352
+
353
+ stub_status on;
354
+
355
+ access_log off;
356
+
357
+ allow 127.0.0.1;
358
+
359
+ deny all;
360
+
361
+ }
362
+
363
+
364
+
365
+ error_page 500 502 503 504 /500.html;
366
+
367
+ location = /500.html {
368
+
369
+ root /srv/www/hoge_app/current/public/;
370
+
371
+ }
372
+
373
+ ```

1

追記

2017/01/20 01:53

投稿

qaz3330
qaz3330

スコア113

test CHANGED
File without changes
test CHANGED
@@ -71,3 +71,97 @@
71
71
 
72
72
 
73
73
  宜しくお願いします。
74
+
75
+
76
+
77
+
78
+
79
+ ## 追記
80
+
81
+
82
+
83
+ nginx.confの中身も記載致します。
84
+
85
+
86
+
87
+ ```
88
+
89
+ user nginx;
90
+
91
+ worker_processes 10;
92
+
93
+
94
+
95
+ error_log /var/log/nginx/error.log;
96
+
97
+ pid /var/run/nginx.pid;
98
+
99
+
100
+
101
+ events {
102
+
103
+ worker_connections 1024;
104
+
105
+ }
106
+
107
+
108
+
109
+ http {
110
+
111
+ include /etc/nginx/mime.types;
112
+
113
+ default_type application/octet-stream;
114
+
115
+
116
+
117
+
118
+
119
+ access_log /var/log/nginx/access.log;
120
+
121
+
122
+
123
+ sendfile on;
124
+
125
+ tcp_nopush on;
126
+
127
+ tcp_nodelay on;
128
+
129
+
130
+
131
+ keepalive_timeout 65;
132
+
133
+
134
+
135
+ gzip on;
136
+
137
+ gzip_static on;
138
+
139
+ gzip_http_version 1.0;
140
+
141
+ gzip_comp_level 2;
142
+
143
+ gzip_proxied any;
144
+
145
+ gzip_types application/x-javascript application/xhtml+xml application/xml application/xml+rss text/css text/javascript text/plain text/xml;
146
+
147
+ gzip_vary on;
148
+
149
+ gzip_disable "MSIE [1-6].(?!.*SV1)";
150
+
151
+
152
+
153
+ client_max_body_size 4m;
154
+
155
+
156
+
157
+ server_names_hash_bucket_size 64;
158
+
159
+
160
+
161
+ include /etc/nginx/conf.d/*.conf;
162
+
163
+ include /etc/nginx/sites-enabled/*;
164
+
165
+ }
166
+
167
+ ```