Created
August 19, 2019 21:47
-
-
Save Xarkam/fcf310bc4a6cc24bafa508d0c222509c to your computer and use it in GitHub Desktop.
Weblate apache 2 proxy reverse
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
<VirtualHost *:443> | |
ServerAdmin <ADMIN EMAIL HERE> | |
ServerName <SITE DNS NAME HERE> | |
<IfModule mod_disk_cache.c> | |
# "/s" is where Confluence serves "static" stuff. Instruct Apache to cache it: | |
CacheEnable disk /s | |
CacheIgnoreHeaders Set-Cookie | |
CacheRoot "/var/cache/apache2/mod_cache_disk" | |
CacheDirLevels 5 | |
CacheDirLength 3 | |
</IfModule> | |
<IfModule mod_expires.c> | |
# Enable expirations | |
ExpiresActive On | |
# Default directive | |
ExpiresDefault "access plus 1 month" | |
# My favicon | |
ExpiresByType image/x-icon "access plus 1 year" | |
# Images | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" | |
ExpiresByType image/jpg "access plus 1 month" | |
ExpiresByType image/jpeg "access plus 1 month" | |
# CSS | |
ExpiresByType text/css "access plus 1 month" | |
# Javascript | |
ExpiresByType application/javascript "access plus 1 year" | |
</IfModule> | |
# Repositories Proxy Configuration: | |
<Proxy *> | |
Require all granted | |
</Proxy> | |
ProxyRequests Off | |
ProxyPreserveHost On | |
ProxyPass / http://localhost:8082/ | |
ProxyPassReverse / http://localhost:8082/ | |
RewriteEngine on | |
RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L] | |
RequestHeader set X-Forwarded-Port "443" | |
RequestHeader set X-Forwarded-Proto "https" | |
RequestHeader set x-forwarded-for %{CLIENT_IP}e | |
ErrorLog "/var/log/apache2/<SITE NAME>-ssl-error.log" combined | |
CustomLog "/var/log/apache2/<SITE NAME>-ssl-access.log" common combined | |
SSLCertificateFile <YOUR CERTIFICATE FILE> | |
SSLCertificateKeyFile <YOUR KEY FILE> | |
# Uncomment if you using Let's Encrypt service | |
#Include /etc/letsencrypt/options-ssl-apache.conf | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment