52 lines
1.5 KiB
Plaintext
52 lines
1.5 KiB
Plaintext
# CentOS 7 VPN/public proxy server config
|
|
# Place on VPN server: /etc/httpd/conf.d/100001.dhms.in.conf
|
|
|
|
<VirtualHost *:80>
|
|
ServerName 100001.dhms.in
|
|
RewriteEngine On
|
|
RewriteRule ^/(.*)$ https://100001.dhms.in/$1 [R=301,L]
|
|
</VirtualHost>
|
|
|
|
<VirtualHost *:443>
|
|
ServerName 100001.dhms.in
|
|
|
|
SSLEngine On
|
|
SSLCertificateFile /etc/letsencrypt/live/100001.dhms.in/fullchain.pem
|
|
SSLCertificateKeyFile /etc/letsencrypt/live/100001.dhms.in/privkey.pem
|
|
|
|
ProxyRequests Off
|
|
ProxyPreserveHost On
|
|
SSLProxyEngine On
|
|
|
|
RequestHeader set X-Forwarded-Proto "https"
|
|
RequestHeader append X-Forwarded-For %{REMOTE_ADDR}s
|
|
|
|
ProxyTimeout 60
|
|
Timeout 60
|
|
|
|
# Replace with official HealthPlix source IPs
|
|
<Location /healthplix/fetch>
|
|
Require all denied
|
|
Require ip 203.0.113.10
|
|
Require ip 203.0.113.11
|
|
<LimitExcept POST>
|
|
Require all denied
|
|
</LimitExcept>
|
|
</Location>
|
|
|
|
# Replace with your strong shared secret
|
|
RewriteEngine On
|
|
RewriteCond %{REQUEST_URI} ^/healthplix/fetch$
|
|
RewriteCond %{HTTP:X-Healthplix-Secret} !^CHANGE_ME_TO_STRONG_SECRET$
|
|
RewriteRule ^ - [F,L]
|
|
|
|
LimitRequestBody 1048576
|
|
|
|
# Production target: HMS server over VPN
|
|
ProxyPass /healthplix/fetch https://khrc.dhms.in/healthplix/fetch
|
|
ProxyPassReverse /healthplix/fetch https://khrc.dhms.in/healthplix/fetch
|
|
|
|
ErrorLog /var/log/httpd/100001-healthplix-error.log
|
|
CustomLog /var/log/httpd/100001-healthplix-access.log combined
|
|
</VirtualHost>
|