-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3208ec8
commit 1662ed1
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/pages/paas/laravel/how-tos/configure-livewire-trusted-proxy.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Layout from "@/components/Layout"; | ||
import Button from "@/components/Common/button"; | ||
import Section from "@/components/Common/section"; | ||
import Alert from "@/components/Common/alert"; | ||
import Tabs from "@/components/Common/tab"; | ||
import Step from "@/components/Common/step"; | ||
import Card from "@/components/Common/card"; | ||
import Important from "@/components/Common/important"; | ||
import Highlight from "@/components/Common/highlight"; | ||
import Link from "next/link"; | ||
import NextPage from "@/components/Common/nextpage"; | ||
|
||
import Head from "next/head"; | ||
|
||
<Layout> | ||
<Head> | ||
<title>مستندات پیکربندی TrustedProxies در Laravel-livewire - لیارا</title> | ||
</Head> | ||
# پیکربندی TrustedProxies در Laravel-livewire | ||
<hr className="mb-2" /> | ||
|
||
<p> | ||
تمامی درخواستها به سمت برنامهی شما توسط | ||
<a href="https://en.wikipedia.org/wiki/Reverse_proxy" className="text-[#2196f3]"> Reverse proxy </a> | ||
های لیارا هدایت میشوند. برای این که در برنامهیتان بتوانید به آیپی | ||
واقعی کاربر دسترسی داشته باشید و یا این که از قابلیت Signed URL های | ||
Laravel استفاده کنید، لازم است که تغییراتی را در فایل | ||
<Important>app/Http/Middleware/TrustProxies.php</Important> | ||
اعمال کنید. | ||
در این فایل، یک متغیر با نام | ||
<Important >$proxies</Important> | ||
وجود دارد. فقط کافیست که مقدار آن را به | ||
<Important className="code">*</Important> | ||
تغییر دهید. | ||
</p> | ||
|
||
<div className="h-4" /> | ||
<div dir='ltr'> | ||
<Highlight className="php"> | ||
{`<?php | ||
namespace App\\Http\\Middleware; | ||
use Illuminate\\Http\\Request; | ||
use Fideloper\\Proxy\\TrustProxies as Middleware; | ||
class TrustProxies extends Middleware | ||
{ | ||
/** | ||
* The trusted proxies for this application. | ||
* | ||
* @var array|string | ||
*/ | ||
protected $proxies = '*'; | ||
/** | ||
* The headers that should be used to detect proxies. | ||
* | ||
* @var int | ||
*/ | ||
protected $headers = | ||
Request::HEADER_X_FORWARDED_FOR | | ||
Request::HEADER_X_FORWARDED_HOST | | ||
Request::HEADER_X_FORWARDED_PORT | | ||
Request::HEADER_X_FORWARDED_PROTO | | ||
Request::HEADER_X_FORWARDED_AWS_ELB; | ||
}`} | ||
</Highlight> | ||
|
||
</ div> | ||
<div className="h-4" /> | ||
|
||
<Alert variant="info"> | ||
<p> | ||
اگر از فریمورک <a href="https://laravel-livewire.com/" className="text-[#2196f3]">Livewire</a> | ||
در برنامهی لاراولی خود استفاده میکنید، باید حتما تنظیمات مرتبط با | ||
TrustedProxies را انجام بدهید. | ||
</p> | ||
</Alert> | ||
|
||
</Layout> |