File tree Expand file tree Collapse file tree 1 file changed +25
-14
lines changed Expand file tree Collapse file tree 1 file changed +25
-14
lines changed Original file line number Diff line number Diff line change 3737
3838 services . nginx = {
3939 enable = true ;
40+ commonHttpConfig = ''
41+ map $http_accept_language $accept_language {
42+ ~*^de de;
43+ default en;
44+ }
45+ '' ;
4046
41- virtualHosts . "${ cfg . domain } " . locations = {
42- "/" = {
43- root = "${ package } /browser" ;
44- # just something that does not exists
45- index = "X6XewZMsmreGIxx1lCdp0Yo1X4qHTivW" ;
46- tryFiles = "$uri @website" ;
47- extraConfig = ''
48- expires max;
49- access_log off;
50- '' ;
51- } ;
52- "@website" = {
53- recommendedProxySettings = true ;
54- proxyPass = "http://127.0.0.1:4000" ;
47+ virtualHosts . "${ cfg . domain } " = {
48+ extraConfig = ''
49+ rewrite ^/(?!de(?:/|$)|en(?:/|$))(.*)$ /$accept_language/$1 redirect;
50+ '' ;
51+ locations = {
52+ "/" = {
53+ root = "${ package } /browser" ;
54+ # just something that does not exists
55+ index = "X6XewZMsmreGIxx1lCdp0Yo1X4qHTivW" ;
56+ tryFiles = "$uri @website" ;
57+ extraConfig = ''
58+ expires max;
59+ access_log off;
60+ '' ;
61+ } ;
62+ "@website" = {
63+ recommendedProxySettings = true ;
64+ proxyPass = "http://127.0.0.1:4000" ;
65+ } ;
5566 } ;
5667 } ;
5768 } ;
You can’t perform that action at this time.
0 commit comments