まずはじめに Apache と Docker 上のサーバーのポート番号をそれぞれ別のものに変えてください。
80 と 443 はフロントに置かれる nginx が処理するように設定します。
ここでは Apache が 18080 番で Docker が 19090 番で動くと仮定しますが DaichiYasuda さんの設定した任意の番号で読みかえてください。Host
とスキーマがバックエンドに伝わるように記述すると以下のようになります。
nginx
1server {
2 listen 80;
3 listen 443;
4 server_name example.com;
5
6 proxy_set_header Host $http_host;
7 proxy_set_header X-Forwarded-Proto $scheme;
8
9 location / {
10 proxy_pass http://127.0.0.1:18080;
11 }
12}
13
14server {
15 listen 80;
16 listen 443;
17 server_name test.example.com;
18
19 proxy_set_header Host $http_host;
20 proxy_set_header X-Forwarded-Proto $scheme;
21
22 location / {
23 proxy_pass http://127.0.0.1:19090;
24 }
25}
26
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/15 14:47
2017/04/15 14:55
2017/04/15 14:56
2017/04/15 15:09
2017/04/15 15:19
2017/04/15 15:36