#Running directory
ServerRoot "/opt/TongWeb/THS"


#Execution user
<IfModule unixd_module>
User daemon
Group daemon
</IfModule>

#Server administrator
ServerAdmin you@example.com

#Server
ServerName 192.168.20.62:81

#Specify default page if access is a directory
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

#Prevent .htaccess and .htpasswd files from being accessed by clients
<Files ".ht*">
    Require all denied
</Files>

#header Set
<IfModule headers_module>
    RequestHeader unset Proxy early
</IfModule>

#Proxy Set
<Proxy balancer://edoc2>
BalancerMember http://192.168.251.11:6260 loadfactor=1 route=node1
</Proxy>

<Proxy balancer://transport>
BalancerMember http://192.168.251.11:6261 loadfactor=1 route=node1
</Proxy>

<Proxy balancer://orgsync>
BalancerMember http://192.168.251.11:6272 loadfactor=1 route=node1
</Proxy>

<Proxy balancer://wf>
BalancerMember http://192.168.251.11:6270 loadfactor=1 route=node1
</Proxy>

<Proxy balancer://tongSSLCluster>
BalancerMember http://192.168.251.11:6260 loadfactor=1 route=node1
</Proxy>

<VirtualHost _default_:81>
RequestHeader set HOST "%{HTTP_HOST}s%"
ProxyPassMatch ^/document\/upload balancer://transport:6261 stickysession=ROUTEID growth=100
ProxyPassMatch ^/document\/diffupdate balancer://transport:6261 stickysession=ROUTEID growth=100
ProxyPassMatch ^/downLoad\/index balancer://transport:6261 stickysession=ROUTEID growth=100
ProxyPassMatch ^/downLoad\/Index balancer://transport:6261 stickysession=ROUTEID growth=100
ProxyPassMatch ^/downLoad\/GetFile balancer://transport:6261 stickysession=ROUTEID growth=100
ProxyPassMatch ^/signalr balancer://edoc2:6260 stickysession=ROUTEID growth=100
ProxyPassMatch ^/orgsync\/ balancer://orgsync:6272 stickysession=ROUTEID growth=100
ProxyPassMatch ^/edoc2Flow-web balancer://wf:6270/edoc2Flow-web stickysession=ROUTEID growth=100
ProxyPassMatch / balancer://tongSSLCluster stickysession=ROUTEID growth=100
ProxyPassReverse / balancer://tongSSLCluster


</VirtualHost>


#json API
<Location /balancer/set>
SetHandler worker_set
Order Deny,Allow
#Deny from all
Allow from all
Allow from localhost
Allow From 192.168.1.0/24
Allow From 192.168.20.0/24
Allow From 192.168.251.0/24
</Location>

<Location /balancer/common>
SetHandler balancer_common
Order Deny,Allow
#Deny from all
Allow from all
Allow from localhost
Allow From 192.168.1.0/24
Allow From 192.168.251.0/24
</Location>



# Security Settings
ServerSignature Off
ServerTokens Prod
Header set X-Frame-Options sameorigin
Header set X-XSS-Protection "1, mode=block"
Header set Strict-Transport-Security "max-age=30, includeSubDomains"
Header set Expect-CT "enforce, max-age=86400"
#Header set X-Content-Type-Options nosniff
TraceEnable off

#mime module
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
	AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .php
</IfModule>



#SSL module Support
Include bin/https.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLSessionCache "shmcb:logs/ssl_gcache_data(512000)"
</IfModule>
