Proxy : Move resume from root to subdomain.
This commit is contained in:
parent
9e9a6e6ee6
commit
b503778479
|
@ -77,37 +77,10 @@ in
|
|||
eventsConfig = ''
|
||||
worker_connections 4096;
|
||||
'';
|
||||
# TODO: Fix 80 redirect and 403 default.
|
||||
appendHttpConfig = ''
|
||||
proxy_max_temp_file_size 0;
|
||||
proxy_buffering off;
|
||||
|
||||
server {
|
||||
server_name default_server;
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
map $http_accept_language $resume {
|
||||
default https://git.${config.container.domain}/voronind/resume/releases/download/latest/VoronindEn.pdf;
|
||||
~ru https://git.${config.container.domain}/voronind/resume/releases/download/latest/VoronindRu.pdf;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name ${config.container.domain};
|
||||
listen 443 ssl;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/${config.container.domain}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/${config.container.domain}/privkey.pem;
|
||||
include /etc/letsencrypt/conf/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/conf/ssl-dhparams.pem;
|
||||
|
||||
return 301 $resume;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl default_server;
|
||||
server_name _;
|
||||
|
|
|
@ -18,11 +18,6 @@ in
|
|||
}
|
||||
|
||||
location / {
|
||||
# allow ${config.container.localAccess};
|
||||
# allow ${config.container.module.status.address};
|
||||
# allow ${config.container.module.vpn.address};
|
||||
# allow ${config.container.module.frkn.address};
|
||||
# deny all;
|
||||
proxy_pass http://''$${name}$request_uri;
|
||||
}
|
||||
|
||||
|
|
24
container/proxy/host/Resume.nix
Normal file
24
container/proxy/host/Resume.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ container, config, ... }:
|
||||
let
|
||||
domain = "resume.${config.container.domain}";
|
||||
name = "resume";
|
||||
in
|
||||
{
|
||||
${domain} = container.mkServer {
|
||||
extraConfig = ''
|
||||
server_name ${domain};
|
||||
listen 443 ssl;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/${config.container.domain}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/${config.container.domain}/privkey.pem;
|
||||
include /etc/letsencrypt/conf/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/conf/ssl-dhparams.pem;
|
||||
|
||||
if ($http_accept_language ~ ru) {
|
||||
return 301 https://${config.container.module.git.domain}/voronind/resume/releases/download/latest/VoronindRu.pdf;
|
||||
}
|
||||
|
||||
return 301 https://${config.container.module.git.domain}/voronind/resume/releases/download/latest/VoronindEn.pdf;
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue