Score:0

Apache Redirect สำหรับ HTTPS (Nextcloud) นำไปสู่การวนรอบการเปลี่ยนเส้นทาง

ธง co

ฉันจะกำหนดค่า Nextcloud และ Apache ได้อย่างถูกต้องเพื่อให้มีการเปลี่ยนเส้นทาง URL ที่ถูกต้องได้อย่างไร

ฉันได้กำหนดค่า Apache สำหรับการเปลี่ยนเส้นทางของ HTTP เป็น HTTPS โดยใช้วิธีง่ายๆ เปลี่ยนเส้นทาง คำสั่ง:

<โฮสต์เสมือน *:80>
    ชื่อเซิร์ฟเวอร์ "example.com"
    เปลี่ยนเส้นทางถาวร "/" "https://example.com/"
</เวอร์ชวลโฮสต์> # *:80

<โฮสต์เสมือน *:443>
    ชื่อเซิร์ฟเวอร์ "example.com"
    ผู้ดูแลระบบเซิร์ฟเวอร์ "[email protected]"

    SSLEngine เปิดอยู่
    SSLCertificateFile "/etc/ssl/certs/example.com/server.cert.fullchain.pem"
    SSLCertificateKeyFile "/etc/ssl/private/example.private-key.pem"

    นามแฝง "/nextcloud" "/srv/nextcloud/html"
    DocumentRoot "/srv/nextcloud/html"

    <ไดเรกทอรี "/srv/nextcloud/html">
        ต้องได้รับอนุญาตทั้งหมด
        ตัวเลือก +ติดตามSymlinks
        AllowOverride ทั้งหมด
        # â¦
    </ไดเรกทอรี> # /srv/nextcloud/html

</เวอร์ชวลโฮสต์> # *:443

การกำหนดค่า NextCloud ระบุว่าควร (ผ่านการสร้างโดยอัตโนมัติ .htaccess ไฟล์) เขียน URI ใหม่เพื่อปล่อยชื่อไฟล์โมดูล PHP:

<?php
$CONFIG = array (
  // …
  'trusted_domains' => array (
    0 => 'example.com',
  ),
  'overwrite.cli.url' => 'https://example.com/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',
  // …
?>

เซิร์ฟเวอร์เปลี่ยนเส้นทางไม่สำเร็จ แต่กลับเข้าสู่ลูปเปลี่ยนเส้นทางแทน กับ ดีบัก LogLevel ฉันเห็นข้อความแสดงข้อผิดพลาดเหล่านี้:

[จันทร์ พ.ย. 01 06:42:46.246002 2021] [ssl:info] [pid 68035] [ไคลเอนต์ 198.51.100.38:55158] AH01964: การเชื่อมต่อกับชายด์ 7 ถูกสร้างขึ้น (เซิร์ฟเวอร์ example.com:443)
[จันทร์ พ.ย. 01 เวลา 06:42:46.246850 2021] [ssl:debug] [pid 68035] ssl_engine_kernel.c(2393): [client 198.51.100.38:55158] AH02043: พบโฮสต์เสมือน SSL สำหรับชื่อเซิร์ฟเวอร์ example.com
[จันทร์ พ.ย. 01 เวลา 06:42:46.247069 2021] [core:debug] [pid 68035] protocol.c(2428): [client 198.51.100.38:55158] AH03155: เลือกโปรโตคอลจาก , options=h2,http/1.1 สำหรับเซิร์ฟเวอร์ ตัวอย่าง.คอม
[จันทร์ พ.ย. 01 06:42:46.365492 2021] [ssl:debug] [pid 68035] ssl_engine_kernel.c(2252): [client 198.51.100.38:55158] AH02041: โปรโตคอล: TLSv1.3, Cipher: TLS_AES_128_GCM_SHA256 (828/126 บิต)
[จันทร์ พ.ย. 01 06:42:46.365893 2021] [socache_shmcb:debug] [pid 68035] mod_socache_shmcb.c(508): AH00831: socache_shmcb_store (0x01 -> subcache 1)
[จันทร์ พ.ย. 01 06:42:46.366041 2021] [socache_shmcb:debug] [pid 68035] mod_socache_shmcb.c(745): AH00842: หมดอายุ 1 และเรียกคืน 0 รายการ socache ที่ถูกลบ
[จันทร์ พ.ย. 01 06:42:46.366168 2021] [socache_shmcb:debug] [pid 68035] mod_socache_shmcb.c(765): AH00843: ขณะนี้เรามี 0 รายการ socache
[จันทร์ พ.ย. 01 06:42:46.366270 2021] [socache_shmcb:debug] [pid 68035] mod_socache_shmcb.c(862): AH00847: การแทรกเกิดขึ้นที่ idx=0, data=(0:32)
[จันทร์ พ.ย. 01 06:42:46.366369 2021] [socache_shmcb:debug] [pid 68035] mod_socache_shmcb.c(865): AH00848: แทรกเสร็จแล้ว, แคชย่อย: idx_pos/idx_used=0/1, data_pos/data_used=0/207
[จันทร์ พ.ย. 01 06:42:46.366466 2021] [socache_shmcb:debug] [pid 68035] mod_socache_shmcb.c(530): AH00834: ออกจาก socache_shmcb_store สำเร็จ
[จันทร์ พ.ย. 01 06:42:46.370419 2021] [ssl:debug] [pid 68035] ssl_engine_kernel.c(415): [client 198.51.100.38:55158] AH02034: เริ่มต้น (No.1) ได้รับคำขอ HTTPS สำหรับลูก 7 ( เซิร์ฟเวอร์ example.com:443)
[จันทร์ พ.ย. 01 เวลา 06:42:46.371270 2021] [authz_core:debug] [pid 68035] mod_authz_core.c(815): [client 198.51.100.38:55158] AH01626: ผลการอนุญาตของ Require all granted: ได้รับ
[จันทร์ พ.ย. 01 06:42:46.371449 2021] [authz_core:debug] [pid 68035] mod_authz_core.c(815): [client 198.51.100.38:55158] AH01626: ผลการอนุญาตของ <RequireAny>: อนุญาต
[จันทร์ พ.ย. 01 06:42:46.371837 2021] [core:info] [pid 68035] [client 198.51.100.38:55158] AH00128: ไม่มีไฟล์: /srv/nextcloud/html/favicon.ico
[จันทร์ พ.ย. 01 เวลา 06:42:46.372023 2021] [authz_core:debug] [pid 68035] mod_authz_core.c(815): [client 198.51.100.38:55158] AH01626: ผลการอนุญาตของ Require all granted: ได้รับ
[จันทร์ พ.ย. 01 06:42:46.372108 2021] [authz_core:debug] [pid 68035] mod_authz_core.c(815): [client 198.51.100.38:55158] AH01626: ผลการอนุญาตของ <RequireAny>: อนุญาต
[จันทร์ พ.ย. 01 06:42:46.373282 2021] [core:error] [pid 68035] [client 198.51.100.38:55158] AH00124: คำขอเกินขีดจำกัด 10 การเปลี่ยนเส้นทางภายในเนื่องจากข้อผิดพลาดในการกำหนดค่าที่เป็นไปได้ ใช้ 'LimitInternalRecursion' เพื่อเพิ่มขีดจำกัดหากจำเป็น ใช้ 'การแก้ปัญหา LogLevel' เพื่อรับการย้อนกลับ
[จันทร์ พ.ย. 01 06:42:46.373383 2021] [core:debug] [pid 68035] core.c(3947): [client 198.51.100.38:55158] AH00121: r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 06:42:46.373461 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 เวลา 06:42:46.373535 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 เวลา 06:42:46.373608 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 06:42:46.373680 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 06:42:46.373754 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 06:42:46.373826 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 06:42:46.373898 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 06:42:46.373971 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/index.php
[จันทร์ พ.ย. 01 เวลา 06:42:46.374044 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: redirected from r->uri = /nextcloud/
[จันทร์ พ.ย. 01 06:42:46.374116 2021] [core:debug] [pid 68035] core.c(3953): [client 198.51.100.38:55158] AH00122: เปลี่ยนเส้นทางจาก r->uri = /favicon.ico
[จันทร์ พ.ย. 01 06:42:46.374214 2021] [ส่วนหัว:debug] [pid 68035] mod_headers.c(890): AH01503: ส่วนหัว: ap_headers_error_filter()

ความตั้งใจคือการใช้การกำหนดค่าของ Nextcloud เพื่อเขียน URL ใหม่อย่างสวยงาม และใช้ Apache เปลี่ยนเส้นทาง เพื่อเปลี่ยนเส้นทางคำขอ HTTP ไปยัง HTTPS ที่เทียบเท่า เกิดอะไรขึ้นที่นี่ และฉันจะทำสิ่งนี้ให้ถูกต้องได้อย่างไร

โพสต์คำตอบ

คนส่วนใหญ่ไม่เข้าใจว่าการถามคำถามมากมายจะปลดล็อกการเรียนรู้และปรับปรุงความสัมพันธ์ระหว่างบุคคล ตัวอย่างเช่น ในการศึกษาของ Alison แม้ว่าผู้คนจะจำได้อย่างแม่นยำว่ามีคำถามกี่ข้อที่ถูกถามในการสนทนา แต่พวกเขาไม่เข้าใจความเชื่อมโยงระหว่างคำถามและความชอบ จากการศึกษาทั้ง 4 เรื่องที่ผู้เข้าร่วมมีส่วนร่วมในการสนทนาด้วยตนเองหรืออ่านบันทึกการสนทนาของผู้อื่น ผู้คนมักไม่ตระหนักว่าการถามคำถามจะมีอิทธิพลหรือมีอิทธิพลต่อระดับมิตรภาพระหว่างผู้สนทนา