feat: Add deployment to a staging environment
This commit is contained in:
parent
d2a29e8dec
commit
54988257e6
4 changed files with 161 additions and 13 deletions
56
staging.nginx.nix
Normal file
56
staging.nginx.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
||||
# Recommended settings
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
|
||||
# Virtual hosts configuration for local staging
|
||||
virtualHosts = {
|
||||
|
||||
# Main website - Static HTML/CSS
|
||||
# Access via http://localhost or http://localhost:80
|
||||
"localhost" = {
|
||||
# No SSL for local development
|
||||
listen = [
|
||||
{ addr = "127.0.0.1"; port = 80; }
|
||||
{ addr = "0.0.0.0"; port = 80; }
|
||||
];
|
||||
|
||||
root = "/srv/www/stage.binning.net";
|
||||
|
||||
locations."/" = {
|
||||
index = "index.html";
|
||||
tryFiles = "$uri $uri/ =404";
|
||||
extraConfig = ''
|
||||
# Enable Server Side Includes for navbar/footer includes
|
||||
ssi on;
|
||||
'';
|
||||
};
|
||||
|
||||
# Private blog articles with HTTP basic authentication
|
||||
locations."/blog/private/" = {
|
||||
extraConfig = ''
|
||||
auth_basic "Private Articles";
|
||||
auth_basic_user_file /srv/nginx/.htpasswd;
|
||||
|
||||
# Enable Server Side Includes
|
||||
ssi on;
|
||||
'';
|
||||
};
|
||||
|
||||
# Custom 404 page
|
||||
extraConfig = ''
|
||||
error_page 404 /404.html;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Firewall - allow local HTTP access
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue