mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
hosts/plover: add nginx content caching for select services
This commit is contained in:
parent
9d9d5e240f
commit
4c71c61768
@ -174,6 +174,9 @@ in
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://localhost:${toString config.services.gitea.settings.server.HTTP_PORT}";
|
proxyPass = "http://localhost:${toString config.services.gitea.settings.server.HTTP_PORT}";
|
||||||
};
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_cache ${config.services.nginx.proxyCachePath.apps.keysZoneName};
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configuring fail2ban for this service which thankfully has a dedicated page
|
# Configuring fail2ban for this service which thankfully has a dedicated page
|
||||||
|
@ -17,10 +17,25 @@
|
|||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
|
|
||||||
|
proxyCachePath.apps = {
|
||||||
|
enable = true;
|
||||||
|
keysZoneName = "apps";
|
||||||
|
};
|
||||||
|
|
||||||
|
appendConfig = ''
|
||||||
|
worker_processes auto;
|
||||||
|
'';
|
||||||
|
|
||||||
# We're avoiding any service to be the default server especially that it
|
# We're avoiding any service to be the default server especially that it
|
||||||
# could be used for enter a service with unencrypted HTTP. So we're setting
|
# could be used for enter a service with unencrypted HTTP. So we're setting
|
||||||
# up one with an unresponsive server response.
|
# up one with an unresponsive server response.
|
||||||
appendHttpConfig = ''
|
appendHttpConfig = ''
|
||||||
|
# https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/
|
||||||
|
proxy_cache_min_uses 5;
|
||||||
|
proxy_cache_valid 200 302 10m;
|
||||||
|
proxy_cache_valid 404 1m;
|
||||||
|
proxy_no_cache $http_pragma $http_authorization;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
listen [::]:80 default_server;
|
listen [::]:80 default_server;
|
||||||
|
@ -154,6 +154,9 @@ in
|
|||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_cache ${config.services.nginx.proxyCachePath.apps.keysZoneName};
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configuring fail2ban for this service which thankfully has a dedicated page
|
# Configuring fail2ban for this service which thankfully has a dedicated page
|
||||||
|
Loading…
Reference in New Issue
Block a user