お名前VPSにて、Ubuntu 16.04をインストールしDocker-composeにてnginx-proxyを使ってマルチサイト構築を試してみたのですが
httpsでのアクセスができず、ご教授いただけると助かります。
ブラウザにて確認しましたところ、http(80)は正常でしたが、https(443)は接続できませんでした。
そこで、ポート開放が正常に行われているか確認するために、外部サイトからポート確認しましたがそちらでもhttps(443)はアクセスできませんでした。
確認したサイト:https://www.cman.jp/network/support/port.html
ファイアウォールの設定だと思い何度か試してみましたがうまくいきません。
2−3度 リブートも試しました
- バージョン
Ubuntu 16.04.3 LTS (Xenial Xerus)
Docker version 17.09.0-ce, build afdb6d4
docker-compose version 1.17.0, build ac53b73
ファイアウォール (ufw) 状態: アクティブ To Action From -- ------ ---- ***** ALLOW Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere
- sudo netstat -anltp | grep LISTEN
tcp 0 0 0.0.0.0:***** 0.0.0.0:* LISTEN 1243/sshd tcp6 0 0 :::80 :::* LISTEN 3040/docker-proxy tcp6 0 0 :::443 :::* LISTEN 3022/docker-proxy tcp6 0 0 :::***** :::* LISTEN 1243/sshd
- docker ps
5374302bcbed | jrcs/letsencrypt-nginx-proxy-companion | 8c2d84295ecf | php:apache | 80/tcp 1889f139ec75 | jwilder/nginx-proxy | 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
- docker-compose.yml
LetsEncryptのホスト情報とメールアドレスはダミーですが、/certs/の中には証明書が出来ています。
version: "2" services: proxy: image: jwilder/nginx-proxy container_name: unimatrix_zero_proxy networks: - unimatrix_zero ports: - "80:80" - "443:443" volumes: - ./certs:/etc/nginx/certs:ro - /etc/nginx/vhost.d - /usr/share/nginx/html - /var/run/docker.sock:/tmp/docker.sock:ro restart: always logging: options: max-size: 5m max-file: "10" privileged: true letsencrypt-nginx-proxy-companion: image: jrcs/letsencrypt-nginx-proxy-companion container_name: alpha_quadrant volumes: - ./certs:/etc/nginx/certs - /var/run/docker.sock:/var/run/docker.sock:ro volumes_from: - proxy restart: always networks: - unimatrix_zero web: image: php:apache container_name: jonathan_archer environment: VIRTUAL_HOST: example.com LETSENCRYPT_HOST: example.com LETSENCRYPT_EMAIL: my@example.com restart: always volumes: - ./DocumentRoot:/var/www/html logging: options: max-size: 5m max-file: "10" privileged: true networks: - unimatrix_zero networks: unimatrix_zero: external: true
追記 2017/11/18
前述のdocker-compose.ymlファイルにあるwebのconfファイルを確認しました
/etc/apache2/sites-enabled <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost>
回答1件
あなたの回答
tips
プレビュー