Nextcloud: Difference between revisions

imported>Onny
No edit summary
imported>SuperSandro2000
Replace NixOS container wby simply changing the nginx listening port
Line 31: Line 31:
=== Use alternative web server ===
=== Use alternative web server ===


In case port 80 is already used by a different application or you're using a different web server than [[Nginx]], which is used by the Nextcloud module, you can put this service into a native [[NixOS_Containers|NixOS container]] with a separate network subnet. Regarding the minimal example above, it should work like this:
In case port 80 is already used by a different application or you're using a different web server than [[Nginx]], which is used by the Nextcloud module, you can change the listening port with the following option: <code>services.nginx.virtualHosts."localhost".listen = [ { addr = "127.0.0.1"; port = 8080; } ];</code>.  
 
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
networking.nat = {
  enable = true;
  internalInterfaces = ["ve-+"];
  externalInterface = "ens3";
};
 
containers.nextcloud = {
  autoStart = true;               
  privateNetwork = true;         
  hostAddress = "192.168.100.10";
  localAddress = "192.168.100.11";
  config = { config, pkgs, ... }: {
 
    services.nextcloud = {                   
      enable = true;                 
      package = pkgs.nextcloud24;
      hostName = "localhost";
      config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
    };
 
    system.stateVersion = "22.05";
 
    networking.firewall = {
      enable = true;
      allowedTCPPorts = [ 80 ];
    };
 
  };
};
</nowiki>}}
 
After applying this configuration, your Nextcloud instance will be available at http://192.168.100.11


== Troubleshooting ==
== Troubleshooting ==