Bug description
When configuring trusted proxies, all untrusted HTTP Site links will be cached caused by PR #9645. This causes issues where HTTPS Site links are required, e.g. for resolving the correct Site in a Multi-Site setup as described in #10079. I have opened a new issue because it may also cause other problems where HTTPS Site links are required by Statamic.
How to reproduce
- Run Statamic behind a reverse proxy, e.g. use nginx with the following config:
location / {proxy_passhttp://statamic:80; # replace with statamic service
proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto $scheme;}- In Statamic enable Trusted Proxies middleware, e.g. using
$middleware->trustProxies(at: '*'); - Use a multi site setup with the following sites config:
default:
name: Englishlocale: enurl: /ende:
name: Deutschlocale: deurl: /de
- Access frontend through reverse proxy. All urls 404.
When reverting #9645, this resolves this issue.
The mentioned issue #10079 describes a workaround for the problem and suggests using absolute urls in the site config, but I think it would be better to fix the root cause.
Logs
No response
Environment
EnvironmentApplication Name: LaravelLaravel Version: 11.7.0PHP Version: 8.3.6Composer Version: 2.7.6Environment: localDebug Mode: ENABLEDURL: localhost:8082Maintenance Mode: OFFCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: NOT CACHEDDriversBroadcasting: logCache: statamicDatabase: sqliteLogs: stack / singleMail: logQueue: databaseSession: fileStatamicAddons: 0Sites: 2 (English, Deutsch)Stache Watcher: EnabledStatic Caching: DisabledVersion: 5.2.0 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Bug description
When configuring trusted proxies, all untrusted HTTP Site links will be cached caused by PR #9645. This causes issues where HTTPS Site links are required, e.g. for resolving the correct Site in a Multi-Site setup as described in #10079. I have opened a new issue because it may also cause other problems where HTTPS Site links are required by Statamic.
How to reproduce
$middleware->trustProxies(at: '*');When reverting #9645, this resolves this issue.
The mentioned issue #10079 describes a workaround for the problem and suggests using absolute urls in the site config, but I think it would be better to fix the root cause.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response