невозможно подключиться к локальному хосту через ngrok из удаленного интернета - PullRequest
0 голосов
/ 22 апреля 2020

Я пытаюсь поделиться через ngrok докеризованным приложением ( moodle ), обслуживаемым apache2, также докертизированным через маршрутизатор, который прослушивает порт 8080. Теперь я следовал инструкциям для ngrok и вот что я получаю:

enter image description here

Теперь, если я пытаюсь подключиться к URL-адресу ngrok со своего компьютера, у меня нет проблем, но если я пытаюсь сделать это с другого компьютера, я получаю следующее:

enter image description here

Apache 2.4 докеризуется на основе Debian Buster, а 000- default.conf выглядит следующим образом:

        # 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/moodle
        <Directory "/var/www/moodle">
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
        </Directory>


        # 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 /var/log/apache2/error.log
        CustomLog /var/log/apache2/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>

, а ports.conf выглядит следующим образом:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

и, наконец, это мой docker-compose файл:

version: "2.2"

services:
  moodle:
    build:
      context: .
      dockerfile: moodle.Dockerfile
    image: "moodle:0.5"
    ports:
      - "8080:80"
    volumes: 
      - moodle-dir:/var/www/moodle
      - moodle-data:/var/www/moodledata

  mysql:
    image: "mysql:8.0.19"
    environment:
      MYSQL_ROOT_PASSWORD: 
      MYSQL_DATABASE: 
      MYSQL_USER: 
      MYSQL_PASSWORD: 
    volumes: 
      - mysql-data:/var/lib/mysql

volumes:
  moodle-dir:
  moodle-data:
  mysql-data:

Итак, есть идеи, ребята? Хорошего дня.

...