29 lines
1.2 KiB
ApacheConf
29 lines
1.2 KiB
ApacheConf
# Deployed under /citpl_website/ - Apache must proxy API to the Node server.
|
|
# Requires: mod_rewrite, mod_proxy, mod_proxy_http, mod_headers
|
|
# Start Node on the host: npm run server (or pm2 start server/index.js)
|
|
|
|
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
RewriteBase /citpl_website/
|
|
|
|
# Proxy API + uploads to Express (Node) on port 3001
|
|
RewriteRule ^api/(.*)$ http://127.0.0.1:3001/api/$1 [P,L]
|
|
RewriteRule ^uploads/(.*)$ http://127.0.0.1:3001/uploads/$1 [P,L]
|
|
</IfModule>
|
|
|
|
# Allow embedding from this site and https://demo.cavinkare.in/
|
|
# X-Frame-Options cannot allow a third origin - unset it and use CSP only.
|
|
<IfModule mod_headers.c>
|
|
Header always unset X-Frame-Options
|
|
Header unset X-Frame-Options
|
|
Header always edit Content-Security-Policy "frame-ancestors 'none'" "frame-ancestors 'self' https://demo.cavinkare.in/"
|
|
|
|
<FilesMatch "^(preview\.html|index\.html|admin\.html)$">
|
|
Header unset X-Frame-Options
|
|
Header always unset X-Frame-Options
|
|
Header unset Content-Security-Policy
|
|
Header always unset Content-Security-Policy
|
|
Header always set Content-Security-Policy "frame-ancestors 'self' https://demo.cavinkare.in/"
|
|
</FilesMatch>
|
|
</IfModule>
|