# OpenLiteSpeed vhost for app.rangook.ir -- PRODUCTION AS OF 2026-08-27,
# BEFORE the cache-header fix. Kept verbatim as the rollback target.
#
# Do not paste this to "fix" anything. It is the broken state, preserved so
# the change is reversible and so the two failures below stay documented:
#
#   1. No rule for text/html at all. With no Cache-Control, a response
#      carrying only ETag/Last-Modified is not uncacheable -- browsers apply
#      heuristic freshness (~10% of the document's age), so month-old HTML
#      was held for days with no request to the server. The HTTP cache is
#      keyed per URL, so /home/ could be current while /course/view/ was
#      weeks stale. This is what showed users a Buy button for courses they
#      already owned.
#
#   2. The JS types are wrong. This lists application/javascript and
#      application/x-javascript; OLS serves .js as text/javascript. The type
#      never matched, so the entire app bundle got no cache header, while
#      text/css and application/x-font-ttf (correctly named here) did get
#      max-age=43200.
#
# Fixed version: deploy/openlitespeed-vhost.conf
# To roll back: restore the expires block below, then Graceful Restart.

docRoot                   $VH_ROOT
vhDomain                  $VH_NAME
adminEmails               example@example.com
enableGzip                1
enableIpGeo               1

index  {
  useServer               0
  indexFiles index.html
}

errorlog /www/wwwlogs/$VH_NAME_ols.error_log {
  useServer               0
  logLevel                ERROR
  rollingSize             10M
}

accesslog /www/wwwlogs/$VH_NAME_ols.access_log {
  useServer               0
  logFormat               '%{X-Forwarded-For}i %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"'
  logHeaders              5
  rollingSize             10M
  keepDays                10  compressArchive         1
}



expires {
    enableExpires           1
    expiresByType           image/*=A43200,text/css=A43200,application/x-javascript=A43200,application/javascript=A43200,font/*=A43200,application/x-font-ttf=A43200
}

rewrite  {
  enable                  1
  autoLoadHtaccess        1
  include /www/server/panel/vhost/openlitespeed/proxy/app.rangook.ir/urlrewrite/*.conf
  include /www/server/panel/vhost/apache/redirect/app.rangook.ir/*.conf
  include /www/server/panel/vhost/openlitespeed/redirect/app.rangook.ir/*.conf
}
include /www/server/panel/vhost/openlitespeed/proxy/app.rangook.ir/*.conf

include /www/server/panel/vhost/openlitespeed/detail/ssl/app.rangook.ir.conf
include /www/server/panel/vhost/openlitespeed/detail/ssl/app.rangook.ir.conf
