[{"data":1,"prerenderedAt":1295},["ShallowReactive",2],{"navigation":3,"/docs/deployment-and-production/configuring-trusted-proxies":249,"/docs/deployment-and-production/configuring-trusted-proxies-surround":1290},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","/docs","docs",[9,12,48,77,132,160,185,206,219,236],{"title":10,"path":6,"stem":11},"","docs/index",{"title":13,"path":14,"stem":15,"children":16,"icon":47},"Getting Started","/docs/getting-started","docs/1.getting-started/1.index",[17,19,23,27,31,35,39,43],{"title":18,"path":14,"stem":15},"Introduction",{"title":20,"path":21,"stem":22},"Container basics","/docs/getting-started/container-basics","docs/1.getting-started/2.container-basics",{"title":24,"path":25,"stem":26},"Installation","/docs/getting-started/installation","docs/1.getting-started/3.installation",{"title":28,"path":29,"stem":30},"These images vs others","/docs/getting-started/these-images-vs-others","docs/1.getting-started/4.these-images-vs-others",{"title":32,"path":33,"stem":34},"Choosing an image","/docs/getting-started/choosing-an-image","docs/1.getting-started/5.choosing-an-image",{"title":36,"path":37,"stem":38},"Default configurations","/docs/getting-started/default-configurations","docs/1.getting-started/6.default-configurations",{"title":40,"path":41,"stem":42},"Migrating from official PHP images","/docs/getting-started/migrating-from-official-php-images","docs/1.getting-started/7.migrating-from-official-php-images",{"title":44,"path":45,"stem":46},"Contributing","/docs/getting-started/contributing","docs/1.getting-started/99.contributing",false,{"title":49,"path":50,"stem":51,"children":52,"page":47},"Image Variations","/docs/image-variations","docs/2.image-variations",[53,57,61,65,69,73],{"title":54,"path":55,"stem":56},"CLI","/docs/image-variations/cli","docs/2.image-variations/cli",{"title":58,"path":59,"stem":60},"FPM","/docs/image-variations/fpm","docs/2.image-variations/fpm",{"title":62,"path":63,"stem":64},"FPM-Apache","/docs/image-variations/fpm-apache","docs/2.image-variations/fpm-apache",{"title":66,"path":67,"stem":68},"FPM-NGINX","/docs/image-variations/fpm-nginx","docs/2.image-variations/fpm-nginx",{"title":70,"path":71,"stem":72},"FrankenPHP","/docs/image-variations/frankenphp","docs/2.image-variations/frankenphp",{"title":74,"path":75,"stem":76},"NGINX Unit (removed)","/docs/image-variations/unit","docs/2.image-variations/unit",{"title":78,"path":79,"stem":80,"children":81,"page":47},"Framework Guides","/docs/framework-guides","docs/3.framework-guides",[82,123],{"title":83,"icon":47,"defaultOpen":47,"path":84,"stem":85,"children":86,"page":47},"Laravel","/docs/framework-guides/laravel","docs/3.framework-guides/1.laravel",[87,91,95,99,103,107,111,115,119],{"title":88,"path":89,"stem":90},"Automations","/docs/framework-guides/laravel/automations","docs/3.framework-guides/1.laravel/1.automations",{"title":92,"path":93,"stem":94},"Running workers","/docs/framework-guides/laravel/workers","docs/3.framework-guides/1.laravel/2.workers",{"title":96,"path":97,"stem":98},"Health checks","/docs/framework-guides/laravel/health-checks","docs/3.framework-guides/1.laravel/3.health-checks",{"title":100,"path":101,"stem":102},"Horizon","/docs/framework-guides/laravel/horizon","docs/3.framework-guides/1.laravel/4.horizon",{"title":104,"path":105,"stem":106},"Nightwatch","/docs/framework-guides/laravel/nightwatch","docs/3.framework-guides/1.laravel/5.nightwatch",{"title":108,"path":109,"stem":110},"Octane","/docs/framework-guides/laravel/octane","docs/3.framework-guides/1.laravel/6.octane",{"title":112,"path":113,"stem":114},"Queue","/docs/framework-guides/laravel/queue","docs/3.framework-guides/1.laravel/7.queue",{"title":116,"path":117,"stem":118},"Reverb","/docs/framework-guides/laravel/reverb","docs/3.framework-guides/1.laravel/8.reverb",{"title":120,"path":121,"stem":122},"Task scheduler","/docs/framework-guides/laravel/task-scheduler","docs/3.framework-guides/1.laravel/9.task-scheduler",{"title":124,"icon":47,"defaultOpen":47,"path":125,"stem":126,"children":127,"page":47},"WordPress","/docs/framework-guides/wordpress","docs/3.framework-guides/2.wordpress",[128],{"title":129,"path":130,"stem":131},"Using WordPress with Docker","/docs/framework-guides/wordpress/using-wordpress-with-docker","docs/3.framework-guides/2.wordpress/4.using-wordpress-with-docker",{"title":133,"path":134,"stem":135,"children":136,"page":47},"Deployment And Production","/docs/deployment-and-production","docs/4.deployment-and-production",[137,141,145,148,152,156],{"title":138,"path":139,"stem":140},"Packaging your app for deployment","/docs/deployment-and-production/packaging-your-app-for-deployment","docs/4.deployment-and-production/1.packaging-your-app-for-deployment",{"title":142,"path":143,"stem":144},"Configuring SSL","/docs/deployment-and-production/configuring-ssl","docs/4.deployment-and-production/2.configuring-ssl",{"title":96,"path":146,"stem":147},"/docs/deployment-and-production/health-checks","docs/4.deployment-and-production/3.health-checks",{"title":149,"path":150,"stem":151},"Configuring trusted proxies","/docs/deployment-and-production/configuring-trusted-proxies","docs/4.deployment-and-production/4.configuring-trusted-proxies",{"title":153,"path":154,"stem":155},"Production performance tuning","/docs/deployment-and-production/production-performance-tuning","docs/4.deployment-and-production/5.production-performance-tuning",{"title":157,"path":158,"stem":159},"Choosing a host","/docs/deployment-and-production/choosing-a-host","docs/4.deployment-and-production/6.choosing-a-host",{"title":161,"icon":47,"defaultOpen":47,"path":162,"stem":163,"children":164,"page":47},"Customization","/docs/customizing-the-image","docs/5.customizing-the-image",[165,169,173,177,181],{"title":166,"path":167,"stem":168},"Changing php.ini settings","/docs/customizing-the-image/changing-common-php-settings","docs/5.customizing-the-image/1.changing-common-php-settings",{"title":170,"path":171,"stem":172},"Installing PHP extensions","/docs/customizing-the-image/installing-additional-php-extensions","docs/5.customizing-the-image/2.installing-additional-php-extensions",{"title":174,"path":175,"stem":176},"Adding start up scripts","/docs/customizing-the-image/adding-your-own-start-up-scripts","docs/5.customizing-the-image/3.adding-your-own-start-up-scripts",{"title":178,"path":179,"stem":180},"Using S6 Overlay","/docs/customizing-the-image/using-s6-overlay","docs/5.customizing-the-image/4.using-s6-overlay",{"title":182,"path":183,"stem":184},"Understanding file permissions","/docs/customizing-the-image/understanding-file-permissions","docs/5.customizing-the-image/5.understanding-file-permissions",{"title":186,"icon":47,"defaultOpen":47,"path":187,"stem":188,"children":189,"page":47},"Upgrading","/docs/upgrading","docs/6.upgrading",[190,194,198,202],{"title":191,"path":192,"stem":193},"Upgrade guide","/docs/upgrading/upgrade-guide","docs/6.upgrading/1.upgrade-guide",{"title":195,"path":196,"stem":197},"Upgrade to v5","/docs/upgrading/upgrade-to-v5","docs/6.upgrading/2.upgrade-to-v5",{"title":199,"path":200,"stem":201},"Upgrade to v4","/docs/upgrading/upgrade-to-v4","docs/6.upgrading/3.upgrade-to-v4",{"title":203,"path":204,"stem":205},"Upgrade to v3","/docs/upgrading/upgrade-to-v3","docs/6.upgrading/4.upgrade-to-v3",{"title":207,"path":208,"stem":209,"children":210,"page":47},"Troubleshooting","/docs/troubleshooting","docs/7.troubleshooting",[211,215],{"title":212,"path":213,"stem":214},"Common issues","/docs/troubleshooting/common-issues","docs/7.troubleshooting/1.common-issues",{"title":216,"path":217,"stem":218},"Getting help","/docs/troubleshooting/getting-help","docs/7.troubleshooting/2.getting-help",{"title":220,"path":221,"stem":222,"children":223,"page":47},"Security","/docs/security","docs/8.security",[224,228,232],{"title":225,"path":226,"stem":227},"How images are built","/docs/security/how-images-are-built","docs/8.security/1.how-images-are-built",{"title":229,"path":230,"stem":231},"Verifying images","/docs/security/verifying-images","docs/8.security/2.verifying-images",{"title":233,"path":234,"stem":235},"Vulnerability scanning","/docs/security/vulnerability-scanning","docs/8.security/3.vulnerability-scanning",{"title":237,"path":238,"stem":239,"children":240,"page":47},"Reference","/docs/reference","docs/9.reference",[241,245],{"title":242,"path":243,"stem":244},"Environment variable specification","/docs/reference/environment-variable-specification","docs/9.reference/1.environment-variable-specification",{"title":246,"path":247,"stem":248},"Command reference","/docs/reference/command-reference","docs/9.reference/2.command-reference",{"id":250,"title":149,"body":251,"description":1282,"extension":1283,"links":1284,"meta":1285,"navigation":587,"path":150,"redirect":1284,"seo":1288,"stem":151,"__hash__":1289},"docs/docs/4.deployment-and-production/4.configuring-trusted-proxies.md",{"type":252,"value":253,"toc":1274},"minimark",[254,266,274,292,381,477,506,518,530,534,545,562,667,686,690,693,736,739,743,749,796,803,1229,1234,1238,1270],[255,256,257],"lead-p",{},[258,259,260,261,265],"p",{},"Behind a CDN, load balancer, or reverse proxy, the web server sees the proxy's IP address instead of the visitor's. ",[262,263,264],"code",{},"TRUSTED_PROXY"," tells NGINX, Apache, or FrankenPHP which proxies to trust and which header holds the real client IP, so your logs, rate limits, and IP rules use the right address.",[267,268,270,271,273],"h2",{"id":269},"choose-a-trusted_proxy-value","Choose a ",[262,272,264],{}," value",[258,275,276,277,279,280,283,284,287,288,291],{},"Set ",[262,278,264],{}," on the ",[262,281,282],{},"fpm-nginx",", ",[262,285,286],{},"fpm-apache",", or ",[262,289,290],{},"frankenphp"," image:",[293,294,301],"pre",{"className":295,"code":296,"filename":297,"highlights":298,"language":300,"meta":10,"style":10},"language-yaml shiki shiki-themes github-dark","services:\n  php:\n    image: serversideup/php:8.5-fpm-nginx\n    ports:\n      - 80:8080\n    environment:\n      # cloudflare (default), sucuri, local, or off\n      TRUSTED_PROXY: \"local\"\n","compose.yml",[299],8,"yaml",[262,302,303,316,324,337,345,354,362,369],{"__ignoreMap":10},[304,305,308,312],"span",{"class":306,"line":307},"line",1,[304,309,311],{"class":310},"s4JwU","services",[304,313,315],{"class":314},"s95oV",":\n",[304,317,319,322],{"class":306,"line":318},2,[304,320,321],{"class":310},"  php",[304,323,315],{"class":314},[304,325,327,330,333],{"class":306,"line":326},3,[304,328,329],{"class":310},"    image",[304,331,332],{"class":314},": ",[304,334,336],{"class":335},"sU2Wk","serversideup/php:8.5-fpm-nginx\n",[304,338,340,343],{"class":306,"line":339},4,[304,341,342],{"class":310},"    ports",[304,344,315],{"class":314},[304,346,348,351],{"class":306,"line":347},5,[304,349,350],{"class":314},"      - ",[304,352,353],{"class":335},"80:8080\n",[304,355,357,360],{"class":306,"line":356},6,[304,358,359],{"class":310},"    environment",[304,361,315],{"class":314},[304,363,365],{"class":306,"line":364},7,[304,366,368],{"class":367},"sAwPA","      # cloudflare (default), sucuri, local, or off\n",[304,370,373,376,378],{"class":371,"line":299},[306,372],"highlight",[304,374,375],{"class":310},"      TRUSTED_PROXY",[304,377,332],{"class":314},[304,379,380],{"class":335},"\"local\"\n",[382,383,384,400],"table",{},[385,386,387],"thead",{},[388,389,390,394,397],"tr",{},[391,392,393],"th",{},"Value",[391,395,396],{},"Trusts",[391,398,399],{},"Reads the client IP from",[401,402,403,433,451,465],"tbody",{},[388,404,405,412,423],{},[406,407,408,411],"td",{},[262,409,410],{},"cloudflare"," (default)",[406,413,414,422],{},[415,416,421],"a",{"href":417,"rel":418,"target":420},"https://www.cloudflare.com/ips/",[419],"nofollow","_blank","Cloudflare's IP ranges"," and private networks",[406,424,425,428,429,432],{},[262,426,427],{},"CF-Connecting-IP"," (FrankenPHP falls back to ",[262,430,431],{},"X-Forwarded-For",")",[388,434,435,440,447],{},[406,436,437],{},[262,438,439],{},"sucuri",[406,441,442,422],{},[415,443,446],{"href":444,"rel":445,"target":420},"https://docs.sucuri.net/website-firewall/sucuri-firewall-troubleshooting-guide/",[419],"Sucuri's IP ranges",[406,448,449],{},[262,450,431],{},[388,452,453,458,461],{},[406,454,455],{},[262,456,457],{},"local",[406,459,460],{},"Private networks only",[406,462,463],{},[262,464,431],{},[388,466,467,472,475],{},[406,468,469],{},[262,470,471],{},"off",[406,473,474],{},"Nothing. The web server logs the address that connected to it.",[406,476],{},[258,478,479,480,283,483,283,486,283,489,283,492,495,496,499,500,502,503,505],{},"\"Private networks\" means ",[262,481,482],{},"10.0.0.0/8",[262,484,485],{},"172.16.0.0/12",[262,487,488],{},"192.168.0.0/16",[262,490,491],{},"127.0.0.0/8",[262,493,494],{},"::1",", and ",[262,497,498],{},"fd00::/8",", which covers Docker networks. Every option except ",[262,501,471],{}," includes them. If you run Traefik or Caddy in Docker behind Cloudflare, ",[262,504,410],{}," already covers both.",[258,507,508,509,511,512,514,515,517],{},"Use ",[262,510,457],{}," when your own reverse proxy is the only thing in front of the container. ",[262,513,410],{}," won't work there. NGINX and Apache only read ",[262,516,427],{},", which doesn't exist without Cloudflare. They keep the proxy's IP.",[258,519,520,521,523,524,526,527,529],{},"The ",[262,522,410],{}," option reads ",[262,525,427],{}," because Cloudflare sets it on every request and proxies like Traefik pass it through unchanged. Many proxies rewrite ",[262,528,431],{}," unless you configure them to trust Cloudflare's ranges.",[267,531,533],{"id":532},"what-laravel-still-needs","What Laravel still needs",[258,535,536,537,540,541,544],{},"The web server passes the visitor's IP to PHP as ",[262,538,539],{},"REMOTE_ADDR",". That makes ",[262,542,543],{},"request()->ip()"," correct with no Laravel configuration.",[258,546,547,548,551,552,555,556,561],{},"When your proxy terminates HTTPS, Laravel also needs to know the original scheme so it generates ",[262,549,550],{},"https://"," URLs. Trust only the ",[262,553,554],{},"X-Forwarded-Proto"," header in Laravel's ",[415,557,560],{"href":558,"rel":559,"target":420},"https://laravel.com/docs/requests#configuring-trusted-proxies",[419],"trusted proxy configuration",":",[293,563,568],{"className":564,"code":565,"filename":566,"language":567,"meta":10,"style":10},"language-php shiki shiki-themes github-dark","use Illuminate\\Http\\Request;\n\n->withMiddleware(function (Middleware $middleware) {\n    $middleware->trustProxies(\n        at: '*',\n        headers: Request::HEADER_X_FORWARDED_PROTO,\n    );\n})\n","bootstrap/app.php","php",[262,569,570,583,589,613,626,639,657,662],{"__ignoreMap":10},[304,571,572,576,580],{"class":306,"line":307},[304,573,575],{"class":574},"snl16","use",[304,577,579],{"class":578},"sDLfK"," Illuminate\\Http\\Request",[304,581,582],{"class":314},";\n",[304,584,585],{"class":306,"line":318},[304,586,588],{"emptyLinePlaceholder":587},true,"\n",[304,590,591,594,598,601,604,607,610],{"class":306,"line":326},[304,592,593],{"class":574},"->",[304,595,597],{"class":596},"svObZ","withMiddleware",[304,599,600],{"class":314},"(",[304,602,603],{"class":574},"function",[304,605,606],{"class":314}," (",[304,608,609],{"class":578},"Middleware",[304,611,612],{"class":314}," $middleware) {\n",[304,614,615,618,620,623],{"class":306,"line":339},[304,616,617],{"class":314},"    $middleware",[304,619,593],{"class":574},[304,621,622],{"class":596},"trustProxies",[304,624,625],{"class":314},"(\n",[304,627,628,631,633,636],{"class":306,"line":347},[304,629,630],{"class":596},"        at",[304,632,332],{"class":314},[304,634,635],{"class":335},"'*'",[304,637,638],{"class":314},",\n",[304,640,641,644,646,649,652,655],{"class":306,"line":356},[304,642,643],{"class":596},"        headers",[304,645,332],{"class":314},[304,647,648],{"class":578},"Request",[304,650,651],{"class":574},"::",[304,653,654],{"class":578},"HEADER_X_FORWARDED_PROTO",[304,656,638],{"class":314},[304,658,659],{"class":306,"line":364},[304,660,661],{"class":314},"    );\n",[304,663,664],{"class":306,"line":299},[304,665,666],{"class":314},"})\n",[668,669,670],"caution",{},[258,671,672,675,676,678,679,682,683,685],{},[262,673,674],{},"at: '*'"," trusts whatever address connected to PHP, which is the visitor once the web server has replaced ",[262,677,539],{},". Use it only when visitors can't reach the container directly and every request passes through your proxy. Don't add ",[262,680,681],{},"HEADER_X_FORWARDED_FOR",". Cloudflare appends to ",[262,684,431],{}," instead of replacing it. Laravel would then return an address the visitor wrote into that header.",[267,687,689],{"id":688},"keep-the-proxy-chain-closed","Keep the proxy chain closed",[258,691,692],{},"A trusted proxy configuration only protects you if traffic can't skip the proxy:",[694,695,696,711,723],"ul",{},[697,698,699,703,704,706,707,710],"li",{},[700,701,702],"strong",{},"Accept traffic only from your CDN."," A client that connects straight to your reverse proxy can send a forged ",[262,705,427],{}," header, and the proxy passes it along. Allow only your CDN's IP ranges at the edge, for example with a firewall rule or Traefik's ",[262,708,709],{},"ipAllowList"," middleware.",[697,712,713,716,717,719,720,722],{},[700,714,715],{},"Match the option to your setup."," Don't use ",[262,718,410],{}," or ",[262,721,439],{}," unless traffic comes through that service.",[697,724,725,728,729,732,733,735],{},[700,726,727],{},"Expect FrankenPHP to resolve differently."," FrankenPHP uses Caddy's ",[262,730,731],{},"trusted_proxies_strict"," mode, which reads ",[262,734,431],{}," from right to left and stops at the first untrusted address. When every address in the chain is trusted (a client on a private network behind a private proxy), FrankenPHP reports the proxy's address, while NGINX and Apache report the leftmost address.",[258,737,738],{},"CDN IP ranges change. The ranges are part of the image, so pull new images regularly. If you depend on them, compare them with your provider's published list.",[267,740,742],{"id":741},"add-your-own-provider","Add your own provider",[258,744,745,746,748],{},"For a provider that isn't built in, such as AWS ALB or Fastly, add a file to the image and set ",[262,747,264],{}," to its name without the extension:",[382,750,751,761],{},[385,752,753],{},[388,754,755,758],{},[391,756,757],{},"Variation",[391,759,760],{},"File",[401,762,763,774,785],{},[388,764,765,769],{},[406,766,767],{},[262,768,282],{},[406,770,771],{},[262,772,773],{},"/etc/nginx/trusted-proxy/\u003Cname>.conf",[388,775,776,780],{},[406,777,778],{},[262,779,286],{},[406,781,782],{},[262,783,784],{},"/etc/apache2/trusted-proxy/\u003Cname>.conf",[388,786,787,791],{},[406,788,789],{},[262,790,290],{},[406,792,793],{},[262,794,795],{},"/etc/frankenphp/trusted-proxy/\u003Cname>.caddyfile",[258,797,798,799,802],{},"Include the private network ranges so container-to-container traffic still resolves. This example uses ",[262,800,801],{},"3.0.0.0/8"," as a stand-in; replace it with your provider's published ranges.",[804,805,807,834,888,987,1157],"code-tree",{"default-value":806},"Dockerfile",[293,808,812],{"className":809,"code":810,"filename":806,"language":811,"meta":10,"style":10},"language-dockerfile shiki shiki-themes github-dark","FROM serversideup/php:8.5-fpm-nginx\n\nCOPY --chmod=644 docker/trusted-proxy/nginx/aws-alb.conf /etc/nginx/trusted-proxy/aws-alb.conf\n","dockerfile",[262,813,814,822,826],{"__ignoreMap":10},[304,815,816,819],{"class":306,"line":307},[304,817,818],{"class":574},"FROM",[304,820,821],{"class":314}," serversideup/php:8.5-fpm-nginx\n",[304,823,824],{"class":306,"line":318},[304,825,588],{"emptyLinePlaceholder":587},[304,827,828,831],{"class":306,"line":326},[304,829,830],{"class":574},"COPY",[304,832,833],{"class":314}," --chmod=644 docker/trusted-proxy/nginx/aws-alb.conf /etc/nginx/trusted-proxy/aws-alb.conf\n",[293,835,837],{"className":295,"code":836,"filename":297,"language":300,"meta":10,"style":10},"services:\n  php:\n    build: .\n    ports:\n      - 80:8080\n    environment:\n      TRUSTED_PROXY: \"aws-alb\"\n",[262,838,839,845,851,861,867,873,879],{"__ignoreMap":10},[304,840,841,843],{"class":306,"line":307},[304,842,311],{"class":310},[304,844,315],{"class":314},[304,846,847,849],{"class":306,"line":318},[304,848,321],{"class":310},[304,850,315],{"class":314},[304,852,853,856,858],{"class":306,"line":326},[304,854,855],{"class":310},"    build",[304,857,332],{"class":314},[304,859,860],{"class":578},".\n",[304,862,863,865],{"class":306,"line":339},[304,864,342],{"class":310},[304,866,315],{"class":314},[304,868,869,871],{"class":306,"line":347},[304,870,350],{"class":314},[304,872,353],{"class":335},[304,874,875,877],{"class":306,"line":356},[304,876,359],{"class":310},[304,878,315],{"class":314},[304,880,881,883,885],{"class":306,"line":364},[304,882,375],{"class":310},[304,884,332],{"class":314},[304,886,887],{"class":335},"\"aws-alb\"\n",[293,889,894],{"className":890,"code":891,"filename":892,"language":893,"meta":10,"style":10},"language-nginx shiki shiki-themes github-dark","# Private networks and loopback\nset_real_ip_from 10.0.0.0/8;\nset_real_ip_from 172.16.0.0/12;\nset_real_ip_from 192.168.0.0/16;\nset_real_ip_from 127.0.0.0/8;\nset_real_ip_from ::1;\nset_real_ip_from fd00::/8;\n\n# Your provider's ranges\nset_real_ip_from 3.0.0.0/8;\n\nreal_ip_header X-Forwarded-For;\nreal_ip_recursive on;\n","docker/trusted-proxy/nginx/aws-alb.conf","nginx",[262,895,896,901,909,916,923,930,937,944,948,954,962,967,976],{"__ignoreMap":10},[304,897,898],{"class":306,"line":307},[304,899,900],{"class":367},"# Private networks and loopback\n",[304,902,903,906],{"class":306,"line":318},[304,904,905],{"class":574},"set_real_ip_from ",[304,907,908],{"class":314},"10.0.0.0/8;\n",[304,910,911,913],{"class":306,"line":326},[304,912,905],{"class":574},[304,914,915],{"class":314},"172.16.0.0/12;\n",[304,917,918,920],{"class":306,"line":339},[304,919,905],{"class":574},[304,921,922],{"class":314},"192.168.0.0/16;\n",[304,924,925,927],{"class":306,"line":347},[304,926,905],{"class":574},[304,928,929],{"class":314},"127.0.0.0/8;\n",[304,931,932,934],{"class":306,"line":356},[304,933,905],{"class":574},[304,935,936],{"class":314},"::1;\n",[304,938,939,941],{"class":306,"line":364},[304,940,905],{"class":574},[304,942,943],{"class":314},"fd00::/8;\n",[304,945,946],{"class":306,"line":299},[304,947,588],{"emptyLinePlaceholder":587},[304,949,951],{"class":306,"line":950},9,[304,952,953],{"class":367},"# Your provider's ranges\n",[304,955,957,959],{"class":306,"line":956},10,[304,958,905],{"class":574},[304,960,961],{"class":314},"3.0.0.0/8;\n",[304,963,965],{"class":306,"line":964},11,[304,966,588],{"emptyLinePlaceholder":587},[304,968,970,973],{"class":306,"line":969},12,[304,971,972],{"class":574},"real_ip_header ",[304,974,975],{"class":314},"X-Forwarded-For;\n",[304,977,979,982,985],{"class":306,"line":978},13,[304,980,981],{"class":574},"real_ip_recursive ",[304,983,984],{"class":578},"on",[304,986,582],{"class":314},[293,988,993],{"className":989,"code":990,"filename":991,"language":992,"meta":10,"style":10},"language-apache shiki shiki-themes github-dark","RemoteIPHeader X-Forwarded-For\n\n# Private ranges use InternalProxy so mod_remoteip resolves through Docker network hops\nRemoteIPInternalProxy 10.0.0.0/8\nRemoteIPInternalProxy 172.16.0.0/12\nRemoteIPInternalProxy 192.168.0.0/16\nRemoteIPInternalProxy 127.0.0.0/8\nRemoteIPInternalProxy ::1\nRemoteIPInternalProxy fd00::/8\n\n# Your provider's ranges\nRemoteIPTrustedProxy 3.0.0.0/8\n","docker/trusted-proxy/apache/aws-alb.conf","apache",[262,994,995,1000,1004,1009,1037,1062,1087,1110,1118,1125,1129,1133],{"__ignoreMap":10},[304,996,997],{"class":306,"line":307},[304,998,999],{"class":314},"RemoteIPHeader X-Forwarded-For\n",[304,1001,1002],{"class":306,"line":318},[304,1003,588],{"emptyLinePlaceholder":587},[304,1005,1006],{"class":306,"line":326},[304,1007,1008],{"class":367},"# Private ranges use InternalProxy so mod_remoteip resolves through Docker network hops\n",[304,1010,1011,1014,1017,1020,1023,1025,1027,1029,1031,1034],{"class":306,"line":339},[304,1012,1013],{"class":314},"RemoteIPInternalProxy ",[304,1015,1016],{"class":578},"10",[304,1018,1019],{"class":314},".",[304,1021,1022],{"class":578},"0",[304,1024,1019],{"class":314},[304,1026,1022],{"class":578},[304,1028,1019],{"class":314},[304,1030,1022],{"class":578},[304,1032,1033],{"class":314},"/",[304,1035,1036],{"class":578},"8\n",[304,1038,1039,1041,1044,1046,1049,1051,1053,1055,1057,1059],{"class":306,"line":347},[304,1040,1013],{"class":314},[304,1042,1043],{"class":578},"172",[304,1045,1019],{"class":314},[304,1047,1048],{"class":578},"16",[304,1050,1019],{"class":314},[304,1052,1022],{"class":578},[304,1054,1019],{"class":314},[304,1056,1022],{"class":578},[304,1058,1033],{"class":314},[304,1060,1061],{"class":578},"12\n",[304,1063,1064,1066,1069,1071,1074,1076,1078,1080,1082,1084],{"class":306,"line":356},[304,1065,1013],{"class":314},[304,1067,1068],{"class":578},"192",[304,1070,1019],{"class":314},[304,1072,1073],{"class":578},"168",[304,1075,1019],{"class":314},[304,1077,1022],{"class":578},[304,1079,1019],{"class":314},[304,1081,1022],{"class":578},[304,1083,1033],{"class":314},[304,1085,1086],{"class":578},"16\n",[304,1088,1089,1091,1094,1096,1098,1100,1102,1104,1106,1108],{"class":306,"line":364},[304,1090,1013],{"class":314},[304,1092,1093],{"class":578},"127",[304,1095,1019],{"class":314},[304,1097,1022],{"class":578},[304,1099,1019],{"class":314},[304,1101,1022],{"class":578},[304,1103,1019],{"class":314},[304,1105,1022],{"class":578},[304,1107,1033],{"class":314},[304,1109,1036],{"class":578},[304,1111,1112,1115],{"class":306,"line":299},[304,1113,1114],{"class":314},"RemoteIPInternalProxy ::",[304,1116,1117],{"class":578},"1\n",[304,1119,1120,1123],{"class":306,"line":950},[304,1121,1122],{"class":314},"RemoteIPInternalProxy fd00::/",[304,1124,1036],{"class":578},[304,1126,1127],{"class":306,"line":956},[304,1128,588],{"emptyLinePlaceholder":587},[304,1130,1131],{"class":306,"line":964},[304,1132,953],{"class":367},[304,1134,1135,1138,1141,1143,1145,1147,1149,1151,1153,1155],{"class":306,"line":969},[304,1136,1137],{"class":314},"RemoteIPTrustedProxy ",[304,1139,1140],{"class":578},"3",[304,1142,1019],{"class":314},[304,1144,1022],{"class":578},[304,1146,1019],{"class":314},[304,1148,1022],{"class":578},[304,1150,1019],{"class":314},[304,1152,1022],{"class":578},[304,1154,1033],{"class":314},[304,1156,1036],{"class":578},[293,1158,1163],{"className":1159,"code":1160,"filename":1161,"language":1162,"meta":10,"style":10},"language-caddyfile shiki shiki-themes github-dark","servers {\n    trusted_proxies static \\\n10.0.0.0/8 \\\n172.16.0.0/12 \\\n192.168.0.0/16 \\\n127.0.0.0/8 \\\n::1 \\\nfd00::/8 \\\n3.0.0.0/8\n\n    trusted_proxies_strict\n    client_ip_headers X-Forwarded-For\n}\n","docker/trusted-proxy/aws-alb.caddyfile","caddyfile",[262,1164,1165,1170,1175,1180,1185,1190,1195,1200,1205,1210,1214,1219,1224],{"__ignoreMap":10},[304,1166,1167],{"class":306,"line":307},[304,1168,1169],{},"servers {\n",[304,1171,1172],{"class":306,"line":318},[304,1173,1174],{},"    trusted_proxies static \\\n",[304,1176,1177],{"class":306,"line":326},[304,1178,1179],{},"10.0.0.0/8 \\\n",[304,1181,1182],{"class":306,"line":339},[304,1183,1184],{},"172.16.0.0/12 \\\n",[304,1186,1187],{"class":306,"line":347},[304,1188,1189],{},"192.168.0.0/16 \\\n",[304,1191,1192],{"class":306,"line":356},[304,1193,1194],{},"127.0.0.0/8 \\\n",[304,1196,1197],{"class":306,"line":364},[304,1198,1199],{},"::1 \\\n",[304,1201,1202],{"class":306,"line":299},[304,1203,1204],{},"fd00::/8 \\\n",[304,1206,1207],{"class":306,"line":950},[304,1208,1209],{},"3.0.0.0/8\n",[304,1211,1212],{"class":306,"line":956},[304,1213,588],{"emptyLinePlaceholder":587},[304,1215,1216],{"class":306,"line":964},[304,1217,1218],{},"    trusted_proxies_strict\n",[304,1220,1221],{"class":306,"line":969},[304,1222,1223],{},"    client_ip_headers X-Forwarded-For\n",[304,1225,1226],{"class":306,"line":978},[304,1227,1228],{},"}\n",[258,1230,1231,1232,1019],{},"For Apache or FrankenPHP, copy the matching file to the path in the table above. To try a file without rebuilding, mount it read-only at the same path instead of using ",[262,1233,830],{},[267,1235,1237],{"id":1236},"still-seeing-the-proxys-ip","Still seeing the proxy's IP",[1239,1240,1241,1248,1256],"ol",{},[697,1242,1243,1244,1019],{},"If the container's access log shows your proxy's address, that address isn't in the ranges for the option you chose. Pick another option, or add a file for your provider as shown ",[415,1245,1247],{"href":1246},"#add-your-own-provider","above",[697,1249,1250,1251,1253,1254,1019],{},"Check the header. Cloudflare sends ",[262,1252,427],{},"; most other proxies send ",[262,1255,431],{},[697,1257,1258,1259,1261,1262,1264,1265,1269],{},"If the access log is right but ",[262,1260,543],{}," is wrong, check that Laravel isn't trusting ",[262,1263,431],{}," (see ",[415,1266,1268],{"href":1267},"#what-laravel-still-needs","what Laravel still needs",").",[1271,1272,1273],"style",{},"html pre.shiki code .s4JwU, html code.shiki .s4JwU{--shiki-default:#85E89D}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}",{"title":10,"searchDepth":318,"depth":318,"links":1275},[1276,1278,1279,1280,1281],{"id":269,"depth":318,"text":1277},"Choose a TRUSTED_PROXY value",{"id":532,"depth":318,"text":533},{"id":688,"depth":318,"text":689},{"id":741,"depth":318,"text":742},{"id":1236,"depth":318,"text":1237},"Get the visitor's real IP address when your app runs behind a CDN, load balancer, or reverse proxy.","md",null,{"head":1286,"layout":7},{"title":1287},"Configuring trusted proxies - Docker PHP - Server Side Up",{"title":149,"description":1282},"90wkkOc9i9N_oXLeqogQyj7sCcavTft6-sqP8_3Lask",[1291,1293],{"title":96,"path":146,"stem":147,"description":1292,"children":-1},"How the built-in Docker health check works in each variation, and how to point it at a route in your app.",{"title":153,"path":154,"stem":155,"description":1294,"children":-1},"Turn on OPcache, size it for your app, and tune PHP-FPM workers for production.",1793811941558]