meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sw:apache:proxy [2025/01/11 10:50] niziaksw:apache:proxy [2025/05/29 10:49] (current) niziak
Line 1: Line 1:
 ====== reverse proxy ====== ====== reverse proxy ======
 +
 +===== log x-forwarded-for =====
 +
 +From apache2.conf:
 +<code>
 +https://hub.docker.com/_/php
 +# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
 +# Use mod_remoteip instead.
 +</code>
 +
 +==== enable remoteip module ====
 +
 +Enable the remoteip module:
 +
 +<code bash>sudo a2enmod remoteip</code>
 +
 +<file ini /etc/apache2/conf-available/remoteip.conf>
 +RemoteIPHeader X-Forwarded-For
 +RemoteIPTrustedProxy 192.168.0.0/16
 +</file>
 +
 +<code bash>sudo a2enconf remoteip</code>
 +
 +
 +===== reverse proxy =====
 +
 +<code>
 +ProxyRequests Off
 +SSLEngine On
 +SSLProxyEngine On
 +
 +ProxyPass / https://example.com/    <-- note trailing slash!
 +ProxyPassReverse / https://example.com/    <-- note trailing slash!
 +</code>
 +
  
 ===== app behind location (folder) ===== ===== app behind location (folder) =====