refactor: using cool NixOS option for nginx
This commit is contained in:
parent
fe9794a796
commit
7dbcc63394
|
@ -103,17 +103,13 @@
|
|||
lib.mkIf cfg.enable {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
# this is config for websocket
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
rewrite ^/api/(.*)$ /$1 break;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# Add the following lines for WebSocket support
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue