0

目前,Liferay 和 Apache 服务器是手动部署在服务器上的。

我正在尝试使用现有配置在另一台服务器上使用 Docker Compose 启动 httpd:2.4.39-alpine 和 liferay/dxp:7.1.10-security-dxp-17-202003-3-202006050913。

这些是我的配置:

  1. 码头工人-compose.yml
version: "3.8"
services:
  mydxp:
    build:
      context: build/docker
    networks:
      - test-network
    image: liferay/dxp:7.1.10-security-dxp-17-202003-3-202006050913
    expose:
      - "8282"
    ports:
      - "8282:8080"
  myapache:
    build:
      context: docker-ref/apache
    networks:
      - test-network
    image: httpd:2.4.39-alpine
    expose:
      - "8181"
    ports:
      - "8181:33090"
    volumes:
      - "./docker-ref/apache/htdocs:/usr/local/apache2/htdocs"
      - "./docker-ref/apache/conf:/usr/local/apache2/conf"
networks:
  test-network:
  1. docker-ref/apache/conf/httpd.conf
Listen 33090
  1. docker-ref/apache/conf/extra/httpd-vhosts-local.conf
<VirtualHost *:33090>
    ServerName mydxp

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^127.0.0.1:8282$  [OR]
    RewriteCond %{HTTP_HOST} ^127.0.0.1:8282$
    # CUSTOM RewriteCond %{HTTPS} off
    RewriteRule ^/(?)$ http://%{HTTP_HOST}/web/developer/home

    # CUSTOM RequestHeader set X-Forwarded-Proto "https"
    ProxyPreserveHost On

    # Configuration for proxy page
    ProxyPass /css !
    ProxyPass /fonts/Open_Sans !
    ProxyPass /fonts/FontAwesome !
    ProxyPass /error_pages !
    ProxyPass /img !

    ProxyPass /disable http://%{HTTP_HOST}/error_pages/disable.html

    ErrorDocument 502 /error_pages/502.html

    ProxyPass / http://127.0.0.1:8282/
    ProxyPassReverse / http://127.0.0.1:8282/

    LimitRequestFieldSize 500000
    LimitRequestLine 500000
</VirtualHost>

当这些容器启动时,使用 http://localhost:8282/ 返回 Liferay 的主页,但是当我点击 http://localhost:8181/ 时,我得到“503 Service Unavailable”

有没有办法检查/调试请求被 Apache 丢弃/拒绝的点?谢谢

4

1 回答 1

0

问题在于流量被重定向到哪里。代替

127.0.0.1:8282

我用过

<container_name>:8080

并且流量被正确重定向。

于 2020-08-20T13:03:22.357 回答