<Directory /usr/share/foreman/public/assets>

  # Use standard http expire header for assets instead of ETag
  <IfModule mod_expires.c>
    Header unset ETag
    FileETag None
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
  </IfModule>

  # Return compressed assets if they are precompiled
  <IfModule mod_rewrite.c>
    RewriteEngine on
    # Make sure the browser supports gzip encoding and file with .gz added
    # does exist on disc before we rewrite with the extension
    RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
    RewriteCond %{REQUEST_FILENAME}.gz -s
    RewriteRule ^(.+) $1.gz [L]
    # Set headers for all possible assets which are compressed
    <FilesMatch \.css\.gz$>
      ForceType text/css
      Header set Content-Encoding gzip
      SetEnv no-gzip
    </FilesMatch>
    <FilesMatch \.js\.gz$>
      ForceType text/javascript
      Header set Content-Encoding gzip
      SetEnv no-gzip
    </FilesMatch>
  </IfModule>

</Directory>



  # Use standard http expire header for assets instead of ETag
  <IfModule mod_expires.c>
    Header unset ETag
    FileETag None
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
  </IfModule>

  # Return compressed assets if they are precompiled
  <IfModule mod_rewrite.c>
    RewriteEngine on
    # Make sure the browser supports gzip encoding and file with .gz added
    # does exist on disc before we rewrite with the extension
    RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
    RewriteCond %{REQUEST_FILENAME}.gz -s
    RewriteRule ^(.+) $1.gz [L]
    # Set headers for all possible assets which are compressed
    <FilesMatch \.css\.gz$>
      ForceType text/css
      Header set Content-Encoding gzip
      SetEnv no-gzip
    </FilesMatch>
    <FilesMatch \.js\.gz$>
      ForceType text/javascript
      Header set Content-Encoding gzip
      SetEnv no-gzip
    </FilesMatch>
  </IfModule>

Add rewrite rules in the right section for Foreman vhost
Add rewrite rules in the right section for Foreman vhost
