mirror of
https://codeberg.org/muon/home.git
synced 2025-12-05 23:57:46 +00:00
Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
commit
bdd3a6b8ae
1 changed files with 38 additions and 38 deletions
|
|
@ -42,46 +42,46 @@ in {
|
|||
address = "0.0.0.0";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${hostname}" = let
|
||||
ui = "http://10.0.0.3:${toString port-ui}";
|
||||
backend = "http://10.0.0.3:${toString port}";
|
||||
in lib.mkIf config.mods.server.nginx.enable {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations = {
|
||||
"~ ^/(api|pictrs|feeds|nodeinfo|.well-known)" = {
|
||||
# backend requests
|
||||
proxyPass = backend;
|
||||
proxyWebsockets = true;
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
"/" = {
|
||||
# mixed frontend and backend requests, based on the request headers
|
||||
extraConfig = ''
|
||||
set $proxpass "${ui}";
|
||||
if ($http_accept = "application/activity+json") {
|
||||
set $proxpass "${backend}";
|
||||
}
|
||||
if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
|
||||
set $proxpass "${backend}";
|
||||
}
|
||||
if ($request_method = POST) {
|
||||
set $proxpass "${backend}";
|
||||
}
|
||||
# services.nginx.virtualHosts."${hostname}" = let
|
||||
# ui = "http://10.0.0.3:${toString port-ui}";
|
||||
# backend = "http://10.0.0.3:${toString port}";
|
||||
# in lib.mkIf config.mods.server.nginx.enable {
|
||||
# forceSSL = true;
|
||||
# enableACME = true;
|
||||
# locations = {
|
||||
# "~ ^/(api|pictrs|feeds|nodeinfo|.well-known)" = {
|
||||
# # backend requests
|
||||
# proxyPass = backend;
|
||||
# proxyWebsockets = true;
|
||||
# recommendedProxySettings = true;
|
||||
# };
|
||||
# "/" = {
|
||||
# # mixed frontend and backend requests, based on the request headers
|
||||
# extraConfig = ''
|
||||
# set $proxpass "${ui}";
|
||||
# if ($http_accept = "application/activity+json") {
|
||||
# set $proxpass "${backend}";
|
||||
# }
|
||||
# if ($http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") {
|
||||
# set $proxpass "${backend}";
|
||||
# }
|
||||
# if ($request_method = POST) {
|
||||
# set $proxpass "${backend}";
|
||||
# }
|
||||
|
||||
# Cuts off the trailing slash on URLs to make them valid
|
||||
rewrite ^(.+)/+$ $1 permanent;
|
||||
# # Cuts off the trailing slash on URLs to make them valid
|
||||
# rewrite ^(.+)/+$ $1 permanent;
|
||||
|
||||
proxy_pass $proxpass;
|
||||
# Proxied `Host` header is required to validate ActivityPub HTTP signatures for incoming events.
|
||||
# The other headers are optional, for the sake of better log data.
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# proxy_pass $proxpass;
|
||||
# # Proxied `Host` header is required to validate ActivityPub HTTP signatures for incoming events.
|
||||
# # The other headers are optional, for the sake of better log data.
|
||||
# proxy_set_header X-Real-IP $remote_addr;
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# '';
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue