mastodon: adjust proxy config
This commit is contained in:
parent
4a028c652b
commit
60a78cf8c6
1 changed files with 10 additions and 2 deletions
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
web-domain = "mastodon.kempkens.io";
|
web-domain = "mastodon.kempkens.io";
|
||||||
|
|
||||||
|
nginx-extra-proxy-settings = [
|
||||||
|
"proxy_set_header Host $host;"
|
||||||
|
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
|
||||||
|
"proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;"
|
||||||
|
"proxy_set_header X-Forwarded-Host $host;"
|
||||||
|
"proxy_set_header X-Forwarded-Server $host;"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.mastodon = {
|
services.mastodon = {
|
||||||
|
@ -60,13 +68,11 @@ in
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
WEB_DOMAIN = web-domain;
|
WEB_DOMAIN = web-domain;
|
||||||
LOCAL_HTTPS = "true";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
|
||||||
virtualHosts."${web-domain}" = {
|
virtualHosts."${web-domain}" = {
|
||||||
root = "${config.services.mastodon.package}/public/";
|
root = "${config.services.mastodon.package}/public/";
|
||||||
forceSSL = false;
|
forceSSL = false;
|
||||||
|
@ -81,11 +87,13 @@ in
|
||||||
locations."@proxy" = {
|
locations."@proxy" = {
|
||||||
proxyPass = "http://127.0.0.1:55001";
|
proxyPass = "http://127.0.0.1:55001";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
extraConfig = nginx-extra-proxy-settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
locations."/api/v1/streaming/" = {
|
locations."/api/v1/streaming/" = {
|
||||||
proxyPass = "http://127.0.0.1:55000";
|
proxyPass = "http://127.0.0.1:55000";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
extraConfig = nginx-extra-proxy-settings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue