nextcloud: make oauth logins possible

This commit is contained in:
Ingolf Wagner 2020-03-04 14:37:03 +08:00
parent 006ca4b249
commit 0fdbbada97
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 15 additions and 7 deletions

View file

@ -5,6 +5,7 @@
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedProxySettings = true;
virtualHosts = { virtualHosts = {
"git.ingolf-wagner.de" = { "git.ingolf-wagner.de" = {
@ -201,12 +202,6 @@
locations."/" = { locations."/" = {
proxyPass = "http://workhorse.private:3030"; proxyPass = "http://workhorse.private:3030";
extraConfig = '' extraConfig = ''
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-Host $server_name;
proxy_set_header X-Forwarded-Proto https;
sub_filter "http://seafile.gaykraft.com" "https://seafile.gaykraft.com"; sub_filter "http://seafile.gaykraft.com" "https://seafile.gaykraft.com";
# used for view/edit office file via Office Online Server # used for view/edit office file via Office Online Server

View file

@ -1,6 +1,5 @@
{ pkgs, ... }: { { pkgs, ... }: {
# setup nextcloud in a container # setup nextcloud in a container
containers.nextcloud = { containers.nextcloud = {
bindMounts = { bindMounts = {
@ -56,12 +55,26 @@
# host nginx setup # host nginx setup
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedProxySettings = true;
virtualHosts = { virtualHosts = {
"nextcloud.workhorse.private" = { "nextcloud.workhorse.private" = {
serverAliases =
[ "nextcloud.ingolf-wagner.de" "nextcloud.gaykraft.com" ];
locations."/" = { locations."/" = {
proxyPass = "http://192.168.100.11"; proxyPass = "http://192.168.100.11";
extraConfig = '' extraConfig = ''
# rewrite response bodies
# -----------------------
sub_filter "192.168.100.11" "nextcloud.workhorse.private"; sub_filter "192.168.100.11" "nextcloud.workhorse.private";
# rewrite redirects
# -----------------
#proxy_redirect http://192.168.100.11:80/ http://$host:$server_port/;
#proxy_redirect 192.168.100.11 nextcloud.workhorse.private;
# allow big uploads
# -----------------
client_max_body_size 0; client_max_body_size 0;
''; '';
}; };