| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more contributor license |
| # agreements. See the NOTICE file distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file to you under the Apache License, |
| # Version 2.0 (the "License"); you may not use this file except in compliance with the |
| # License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| # Unless required by applicable law or agreed to in writing, software distributed under the |
| # License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, |
| # either express or implied. See the License for the specific language governing permissions |
| # and limitations under the License. |
| # |
| |
| <VirtualHost *:80> |
| |
| ServerName sling2.apache.org |
| DocumentRoot /var/www/vhosts/sling |
| ErrorLog /var/log/apache2/sling-err.log |
| TransferLog /var/log/apache2/sling-access.log |
| |
| # Configure mod_cache |
| CacheEnable disk / |
| CacheIgnoreNoLastMod On |
| CacheRoot /var/cache/httpd/sling2-apache-org |
| CacheDefaultExpire 600 |
| |
| # Configure mod_expire |
| ExpiresActive On |
| ExpiresDefault "access plus 1 month" |
| ExpiresByType text/html "access plus 5 minutes" |
| ExpiresByType application/json "access plus 5 minutes" |
| ExpiresByType image/gif "access plus 1 year" |
| ExpiresByType image/jpeg "access plus 1 year" |
| ExpiresByType image/png "access plus 1 year" |
| ExpiresByType text/css "access plus 1 month" |
| ExpiresByType text/javascript "access plus 1 month" |
| ExpiresByType application/javascript "access plus 1 month" |
| |
| # Configure Proxy |
| ProxyPass /.well-known ! |
| ProxyPass /ERROR ! |
| ProxyPass /static/clientlibs/reference/ http://cms:8080/static/clientlibs/reference/ connectiontimeout=10 timeout=60 retry=0 |
| ProxyPassReverse /static/clientlibs/reference/ http://cms:8080/static/clientlibs/reference/ |
| ProxyPass / http://cms:8080/content/apache/sling-apache-org/ connectiontimeout=10 timeout=60 retry=0 |
| ProxyPassReverse /content/apache/sling-apache-org/ http://cms:8080/content/apache/sling-apache-org/ |
| |
| # Security / Hardening |
| AllowEncodedSlashes on |
| RewriteRule "^.+\..*\.json" - [F,L] |
| RewriteCond %{REQUEST_METHOD} ^(delete|post|trace|track) [NC] |
| RewriteRule .* - [F,L] |
| Header set X-Frame-Options SAMEORIGIN |
| Header set X-XSS-Protection "1; mode=block" |
| Header set X-Content-Type-Options "nosniff" |
| |
| # Compress text files |
| AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json |
| |
| </VirtualHost> |