質問編集履歴

3

httpの部分追加

2016/02/24 13:58

投稿

sns
sns

スコア11

test CHANGED
File without changes
test CHANGED
@@ -197,3 +197,107 @@
197
197
 
198
198
 
199
199
  SSLを設定する前はhttpでアクセスできていたのでリバースプロキシなどの設定に問題はないかと思います。
200
+
201
+
202
+
203
+ ■追記---------
204
+
205
+
206
+
207
+ 念のためその他の部分も載せておきます
208
+
209
+
210
+
211
+ /////////////////////////////////
212
+
213
+
214
+
215
+ ```ここに言語を入力
216
+
217
+ http {
218
+
219
+ server_tokens off;
220
+
221
+
222
+
223
+ include /etc/nginx/mime.types;
224
+
225
+ default_type application/octet-stream;
226
+
227
+ charset UTF-8;
228
+
229
+
230
+
231
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
232
+
233
+ '$status $body_bytes_sent "$http_referer" '
234
+
235
+ '"$http_user_agent" "$http_x_forwarded_for" "$request_body"';
236
+
237
+
238
+
239
+ access_log /var/log/nginx/access.log main;
240
+
241
+
242
+
243
+ sendfile on;
244
+
245
+ tcp_nopush on;
246
+
247
+
248
+
249
+ keepalive_timeout 15;
250
+
251
+
252
+
253
+ gzip_static on;
254
+
255
+ gzip on;
256
+
257
+ gzip_vary on;
258
+
259
+ gzip_proxied any;
260
+
261
+ gzip_http_version 1.1;
262
+
263
+ gzip_disable "msie6";
264
+
265
+ gzip_disable "Mozilla/4";
266
+
267
+ gzip_comp_level 6;
268
+
269
+ gzip_min_length 1024;
270
+
271
+ gzip_types text/css text/javascript application/javascript application/x-javascript;
272
+
273
+
274
+
275
+ proxy_redirect off;
276
+
277
+ proxy_set_header Host $host;
278
+
279
+ proxy_set_header X-Forwarded-Proto $scheme;
280
+
281
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
282
+
283
+ proxy_set_header X-Forwarded-Host $host;
284
+
285
+ proxy_set_header X-Forwarded-Server $host;
286
+
287
+ proxy_set_header X-Real-IP $remote_addr;
288
+
289
+ proxy_set_header X-Remote-Addr $remote_addr;
290
+
291
+
292
+
293
+ #include /etc/nginx/conf.d/*.conf;
294
+
295
+ include /etc/nginx/conf.d/dropip.conf;
296
+
297
+ include /etc/nginx/conf.d/vhost.conf;
298
+
299
+ }
300
+
301
+
302
+
303
+ ```

2

一部修正

2016/02/24 13:58

投稿

sns
sns

スコア11

test CHANGED
File without changes
test CHANGED
@@ -114,7 +114,7 @@
114
114
 
115
115
 
116
116
 
117
- access_log /var/log/nginx/suitlovers.access.log;
117
+ access_log アクセスログ;
118
118
 
119
119
 
120
120
 
@@ -193,3 +193,7 @@
193
193
  }
194
194
 
195
195
  ```
196
+
197
+
198
+
199
+ SSLを設定する前はhttpでアクセスできていたのでリバースプロキシなどの設定に問題はないかと思います。

1

設定ファイルの一部を公開s

2016/02/24 11:11

投稿

sns
sns

スコア11

test CHANGED
File without changes
test CHANGED
@@ -35,3 +35,161 @@
35
35
 
36
36
 
37
37
  よろしくお願いします。
38
+
39
+
40
+
41
+ ///////////////////////////////////////////////
42
+
43
+
44
+
45
+ 指摘がありましたので設定ファイルの一部を下記に記載します。
46
+
47
+
48
+
49
+ また、サーバの情報ですが
50
+
51
+
52
+
53
+ ```ここに言語を入力
54
+
55
+ CentOS 6.6 64bit
56
+
57
+ Nginx 1.9.11
58
+
59
+ Apache 2.2.29
60
+
61
+ OpenSSL 1.0.1e
62
+
63
+ ```
64
+
65
+
66
+
67
+ になります。
68
+
69
+
70
+
71
+ ```ここに言語を入力
72
+
73
+ server {
74
+
75
+ listen 80 default_server;
76
+
77
+ server_name _;
78
+
79
+ return 444;
80
+
81
+ }
82
+
83
+ server {
84
+
85
+ listen 443 ssl http2 default_server;
86
+
87
+ server_name _;
88
+
89
+ ssl on;
90
+
91
+ ssl_certificate 証明書の場所
92
+
93
+ ssl_certificate_key 鍵の場所
94
+
95
+ return 444;
96
+
97
+ }
98
+
99
+ server {
100
+
101
+ listen 80;
102
+
103
+ server_name test.net;
104
+
105
+ return 301 https://$host$request_uri;
106
+
107
+ }
108
+
109
+ server {
110
+
111
+ listen 443 ssl http2;
112
+
113
+ server_name test.net;
114
+
115
+
116
+
117
+ access_log /var/log/nginx/suitlovers.access.log;
118
+
119
+
120
+
121
+ ssl on;
122
+
123
+
124
+
125
+ ssl_certificate 証明書の場所
126
+
127
+ ssl_certificate_key 鍵の場所
128
+
129
+
130
+
131
+ location ~* \.(hta|htp|git) {
132
+
133
+ deny all;
134
+
135
+ break;
136
+
137
+ }
138
+
139
+
140
+
141
+ location ^~ /images/ {
142
+
143
+ root ドキュメントルート
144
+
145
+ ssi on;
146
+
147
+ expires 1d;
148
+
149
+ access_log off;
150
+
151
+ break;
152
+
153
+ }
154
+
155
+ location ^~ /css/ {
156
+
157
+ root ドキュメントルート
158
+
159
+ ssi on;
160
+
161
+ expires 1d;
162
+
163
+ access_log off;
164
+
165
+ break;
166
+
167
+ }
168
+
169
+ location ^~ /js/ {
170
+
171
+ root ドキュメントルート
172
+
173
+ ssi on;
174
+
175
+ expires 1d;
176
+
177
+ access_log off;
178
+
179
+ break;
180
+
181
+ }
182
+
183
+
184
+
185
+ location / {
186
+
187
+ proxy_pass https://127.0.0.1:8010;
188
+
189
+ break;
190
+
191
+ }
192
+
193
+ }
194
+
195
+ ```