mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: enable csp for liv.town
This commit is contained in:
parent
720e3ae4bf
commit
f3a84a5ce4
1 changed files with 24 additions and 22 deletions
|
|
@ -34,7 +34,7 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = false;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
|
|
||||||
# Hardened TLS and HSTS preloading
|
# Hardened TLS and HSTS preloading
|
||||||
|
|
@ -47,7 +47,7 @@ in {
|
||||||
add_header Strict-Transport-Security $hsts_header;
|
add_header Strict-Transport-Security $hsts_header;
|
||||||
|
|
||||||
# Enable CSP for your services.
|
# Enable CSP for your services.
|
||||||
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
||||||
|
|
||||||
# Minimize information leaked to other domains
|
# Minimize information leaked to other domains
|
||||||
add_header 'Referrer-Policy' 'origin-when-cross-origin';
|
add_header 'Referrer-Policy' 'origin-when-cross-origin';
|
||||||
|
|
@ -73,26 +73,28 @@ in {
|
||||||
"${fqdn}" = {
|
"${fqdn}" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
# This section is not needed if the server_name of matrix-synapse is equal to
|
locations = {
|
||||||
# the domain (i.e. example.org from @foo:example.org) and the federation port
|
# This section is not needed if the server_name of matrix-synapse is equal to
|
||||||
# is 8448.
|
# the domain (i.e. example.org from @foo:example.org) and the federation port
|
||||||
# Further reference can be found in the docs about delegation under
|
# is 8448.
|
||||||
# https://element-hq.github.io/synapse/latest/delegate.html
|
# Further reference can be found in the docs about delegation under
|
||||||
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
# https://element-hq.github.io/synapse/latest/delegate.html
|
||||||
# This is usually needed for homeserver discovery (from e.g. other Matrix clients).
|
"= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
||||||
# Further reference can be found in the upstream docs at
|
# This is usually needed for homeserver discovery (from e.g. other Matrix clients).
|
||||||
# https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
|
# Further reference can be found in the upstream docs at
|
||||||
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
# https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
|
||||||
# It's also possible to do a redirect here or something else, this vhost is not
|
"= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
||||||
# needed for Matrix. It's recommended though to *not put* element
|
# It's also possible to do a redirect here or something else, this vhost is not
|
||||||
# here, see also the section about Element.
|
# needed for Matrix. It's recommended though to *not put* element
|
||||||
locations."/".proxyPass = "http://127.0.0.1:4321";
|
# here, see also the section about Element.
|
||||||
# Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash
|
"/".proxyPass = "http://127.0.0.1:4321";
|
||||||
# *must not* be used here.
|
# Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash
|
||||||
locations."/_matrix".proxyPass = "http://[::1]:8008";
|
# *must not* be used here.
|
||||||
# Forward requests for e.g. SSO and password-resets.
|
"/_matrix".proxyPass = "http://[::1]:8008";
|
||||||
locations."/_synapse/client".proxyPass = "http://[::1]:8008";
|
# Forward requests for e.g. SSO and password-resets.
|
||||||
locations."wp-login.php".return = "301 https://hil-speed.hetzner.com/10GB.bin";
|
"/_synapse/client".proxyPass = "http://[::1]:8008";
|
||||||
|
"wp-login.php".return = "301 https://hil-speed.hetzner.com/10GB.bin";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue