Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
4b1ae82b
Commit
4b1ae82b
authored
Nov 26, 2013
by
Rob
Committed by
Fabien Potencier
Dec 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update http_cache.rst - hint at whitelisting 127.0.0.1 if using HTTP Cache solution
parent
70b55dc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
doc/providers/http_cache.rst
doc/providers/http_cache.rst
+16
-5
No files found.
doc/providers/http_cache.rst
View file @
4b1ae82b
...
...
@@ -54,17 +54,28 @@ setting Response HTTP cache headers::
.. tip::
If you want Silex to trust the ``X-Forwarded-For*`` headers from your
reverse proxy at address $ip, you will need to run your application like
this::
reverse proxy at address $ip, you will need to whitelist it as documented
in `Trusting Proxies
<http:
//
symfony
.
com
/
doc
/
current
/
components
/
http_foundation
/
trusting_proxies
.
html
>
`_.
use Symfony\Component\HttpFoundation\Request;
If you would be running Varnish in front of your application on the same machine:
.. code-block:: php
Request::setTrustedProxies(array($ip));
use Symfony\Component\HttpFoundation\Request;
Request::setTrustedProxies(array('127.0.0.1', '::1'));
$app->run();
This provider allows you to use the Symfony2 reverse proxy natively with
Silex applications by using the ``http_cache`` service::
Silex applications by using the ``http_cache`` service. The Symfony2 reverse proxy
acts much like any other proxy would, so you will want to whitelist it:
.. code-block:: php
use Symfony\Component\HttpFoundation\Request;
Request::setTrustedProxies(array('127.0.0.1'));
$app['http_cache']->run();
The provider also provides ESI support::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment