Skip to content

Instantly share code, notes, and snippets.

@dariok
Last active March 11, 2021 22:42
Show Gist options
  • Save dariok/2e14bbd4e67c211dcfa5e900d978e7c5 to your computer and use it in GitHub Desktop.
Save dariok/2e14bbd4e67c211dcfa5e900d978e7c5 to your computer and use it in GitHub Desktop.
nginx configuration for secure eXist connections
location ~ / {
proxy_pass https://example.com:8443;
proxy_set_header Host $http_host;
add_header Content-Security-Policy "default-src 'none'; img-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://code.jquery.com; style-src 'self' 'unsafe-inline'; style-src-elem 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
}
@dariok
Copy link
Author

dariok commented Mar 11, 2021

2nd revision to allow console to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment