Apache2 ReverseProxy에서 Nginx 단위 하위 폴더 문제

Apache2 ReverseProxy에서 Nginx 단위 하위 폴더 문제

Nginx 유닛을 사용하기 위해 Apache2에서 간단한 역방향 프록시를 구성하고 싶습니다.

   <Location /nextcloud>
        RequestHeader set X-Forwarded-Proto "https"
        RequestHeader set X-Forwarded-Port "443"
    </Location>

    ProxyPass /nextcloud http://127.0.0.1:7788
    ProxyPassReverse /nextcloud http://127.0.0.1:7788

Nginx 장치 구성이 성공했습니다.

curl -X DELETE --unix-socket /var/run/control.unit.sock http://localhost/config/
curl -X PUT --data-binary @config.json --unix-socket /var/run/control.unit.sock http://localhost/config/
tail -n 20 /var/log/unit.log

여기의 Nginx Unit Nextcloud 구성 예:https://unit.nginx.org/howto/nextcloud/

예상대로 작동하지만 단위 앱이 "/nextcloud" 하위 폴더에서 제공될 것이라고 Nginx에 알릴 수 없습니다. https://localhost/nextcloud를 호출하면 https://localhost/index.php로 리디렉션됩니다.

나는 이것이 단위 경로 내에서 문제가 될 수 있다고 생각합니다.

    "routes": [
        {
            "match": {
                "uri": [
                    "/build/*",
                    "/tests/*",
                    "/config/*",
                    "/lib/*",
                    "/3rdparty/*",
                    "/templates/*",
                    "/data/*",
                    "/.*",
                    "/autotest*",
                    "/occ*",
                    "/issue*",
                    "/indie*",
                    "/db_*",
                    "/console*"
                ]
            },

            "action": {
                "return": 404
            }
        },
        {
            "match": {
                "uri": [
                    "/core/ajax/update.php*",
                    "/cron.php*",
                    "/index.php*",
                    "/ocm-provider*.php*",
                    "/ocs-provider*.php*",
                    "/ocs/v1.php*",
                    "/ocs/v2.php*",
                    "/public.php*",
                    "/remote.php*",
                    "/status.php*",
                    "/updater*.php*"
                ]
            },

            "action": {
                "pass": "applications/nextcloud/direct"
            }
        },
        {
            "match": {
                "uri": "/ocm-provider*"
            },

            "action": {
                "pass": "applications/nextcloud/ocm"
            }
        },
        {
            "match": {
                "uri": "/ocs-provider*"
            },

            "action": {
                "pass": "applications/nextcloud/ocs"
            }
        },
        {
            "match": {
                "uri": "/updater*"
            },

            "action": {
                "pass": "applications/nextcloud/updater"
            }
        },
        {
            "action": {
                "share": "/var/www/nextcloud-test/nextcloud-files$uri",
                "fallback": {
                    "pass": "applications/nextcloud/index"
                }
            }
        }
    ],

이미 nginx 단위 호스팅 애플리케이션을 하위 폴더로 보낸 경험이 있는 사람이 있습니까?

Nextcloud 현명한 구성이 조정되었습니다.

  'overwrite.cli.url' => 'https://localhost/nextcloud',
  'overwriteprotocol' => 'https',
  'overwritehost' => 'localhost',
  'overwritewebroot' => '/nextcloud',

관련 정보