Hello. If you try to access my site currently, you’ll get “Error code 521”. I’m hosting this in a modular setup of three flakes, and for some reason everything seems fine over LAN (besides trying to connect to the localhost instance over Firefox.) The three scripts are as follows:
# /etc/nixos/modules/acme.nix
{ pkgs, config, ... }: {
security.acme = {
acceptTerms = true;
defaults.email = "admin@battlegodsworshippers.com";
defaults.webroot = "/var/lib/acme/acme-challenge/";
certs = {
"fs.battlegodsworshippers.com" = {
group = config.services.nginx.group;
};
};
};
}
# /etc/nixos/modules/copyparty.nix
{ pkgs, ... }: {
services.copyparty = {
enable = true;
user = "copyparty";
group = "copyparty";
globalExtraConfig = ''
ah-alg: argon2
'';
settings = {
i = "127.0.0.1";
p = [ 3210 3211 ];
no-reload = true;
ignoredflg = false;
"xff-hdr" = "cf-connecting-ip";
"xff-src" = "lan";
rproxy = 1;
};
accounts = {
autumni.passwordFile = "/etc/nixos/secrets/autumnspass";
sams.passwordFile = "/etc/nixos/secrets/samspass";
};
volumes = {
"/" = {
path = "/home/mothmachine/server/copyparty";
access = {
r = "*";
rw = [ "autumni" "sams" ];
};
flags = {
fk = 4;
scan = 60;
e2d = true;
};
};
};
openFilesLimit = 8192;
package = pkgs.copyparty.override {
extraPackages = [ pkgs.python314Packages.argon2-cffi ];
};
};
}
# /etc/nixos/modules/nginx.nix
{ pkgs, ... }: {
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
httpConfig = ''
proxy_headers_hash_max_size 1024;
proxy_headers_hash_bucket_size 128;
'';
virtualHosts = {
"fs.battlegodsworshippers.com" = {
useACMEHost = "fs.battlegodsworshippers.com";
forceSSL = true;
locations."/.well-known/".root = "/var/lib/acme/acme-challenge/";
locations."/" = {
proxyPass = "http://127.0.0.1:3210";
proxyWebsockets = true;
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-Proto "https";
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Ssl on;
'';
};
};
};
};
}
Journalctl logs of the ACME service are as follows:
Sep 03 22:23:21 nixos systemd[1]: Starting Ensure certificate for fs.battlegodsworshippers.com...
Sep 03 22:23:21 nixos acme-fs.battlegodsworshippers.com-start[654]: Waiting to acquire lock in /run/acme/
Sep 03 22:23:22 nixos acme-fs.battlegodsworshippers.com-start[654]: + '[' -e out/acme-success ']'
Sep 03 22:23:22 nixos acme-fs.battlegodsworshippers.com-start[654]: + exit 0
Sep 03 22:23:22 nixos systemd[1]: Finished Ensure certificate for fs.battlegodsworshippers.com.
Sep 04 09:14:52 nixos systemd[1]: acme-fs.battlegodsworshippers.com.service: Deactivated successfully.
Sep 04 09:14:52 nixos systemd[1]: Stopped Ensure certificate for fs.battlegodsworshippers.com.
Sep 04 09:15:19 nixos systemd[1]: Starting Ensure certificate for fs.battlegodsworshippers.com...
Sep 04 09:15:19 nixos acme-fs.battlegodsworshippers.com-start[5406]: Waiting to acquire lock in /run/acme/
Sep 04 09:15:19 nixos acme-fs.battlegodsworshippers.com-start[5406]: + '[' -e out/acme-success ']'
Sep 04 09:15:19 nixos acme-fs.battlegodsworshippers.com-start[5406]: + exit 0
Sep 04 09:15:19 nixos systemd[1]: Finished Ensure certificate for fs.battlegodsworshippers.com.
This is kinda my last resort, since the bugs have gotten too esoteric for me.
1 Like
How do you have Cloudflare set up to connect to your nginx host? And do you have any nginx logs?
Maybe I have to do this realip thing? I added the given code segment on the wiki.
[mothmachine@nixos:/etc/nixos/modules]$ sudo systemctl status nginx
● nginx.service - Nginx Web Server
Loaded: loaded (/etc/systemd/system/nginx.service; enabled; preset: ignored)
Active: active (running) since Fri 2026-09-04 15:47:39 PDT; 5min ago
Invocation: 5e03f43f62fd45dea20ef09d5d94ea93
Process: 11083 ExecStartPre=/nix/store/2kpr8j1yx3sdz2mr9vjpsb8vpzp1rhlp-unit-script-nginx-pre-start/bin/nginx-pre-start>
Process: 11157 ExecReload=/nix/store/02x438lhk40svzvmv4yxfccvq2jr00c4-nginx-1.30.4/bin/nginx -c /nix/store/wzsacg8w55pq>
Process: 11162 ExecReload=/nix/store/85k56vdxxb75xmgvxj4zhaawyafkchwh-coreutils-9.11/bin/kill -HUP $MAINPID (code=exite>
Main PID: 11089 (nginx)
IP: 0B in, 0B out
IO: 0B read, 0B written
Tasks: 2 (limit: 4494)
Memory: 2.3M (peak: 4.8M)
CPU: 403ms
CGroup: /system.slice/nginx.service
├─11089 "nginx: master process /nix/store/02x438lhk40svzvmv4yxfccvq2jr00c4-nginx-1.30.4/bin/nginx -c /nix/stor>
└─11168 "nginx: worker process"
Sep 04 15:47:39 nixos systemd[1]: Starting Nginx Web Server...
Sep 04 15:47:39 nixos nginx-pre-start[11087]: nginx: the configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-ngi>
Sep 04 15:47:39 nixos nginx-pre-start[11087]: nginx: configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-nginx.c>
Sep 04 15:47:39 nixos systemd[1]: Started Nginx Web Server.
Sep 04 15:47:39 nixos systemd[1]: Reloading Nginx Web Server...
Sep 04 15:47:40 nixos nginx[11157]: nginx: the configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-nginx.conf sy>
Sep 04 15:47:40 nixos nginx[11157]: nginx: configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-nginx.conf test i>
Sep 04 15:47:40 nixos systemd[1]: Reloaded Nginx Web Server.
This looks alright?
[mothmachine@nixos:/etc/nixos/modules]$ sudo journalctl -u nginx -n 20
Sep 04 15:41:33 nixos systemd[1]: nginx.service: Consumed 818ms CPU time over 17h 17min 39.606s wall clock time, 13.9M memo>
Sep 04 15:41:33 nixos systemd[1]: Starting Nginx Web Server...
Sep 04 15:41:33 nixos nginx-pre-start[8923]: nginx: the configuration file /nix/store/ad08a69i5hxx24lcpw1rvrzzw6cf6jqd-ngin>
Sep 04 15:41:33 nixos nginx-pre-start[8923]: nginx: configuration file /nix/store/ad08a69i5hxx24lcpw1rvrzzw6cf6jqd-nginx.co>
Sep 04 15:41:33 nixos systemd[1]: Started Nginx Web Server.
Sep 04 15:41:33 nixos systemd[1]: Reloading Nginx Web Server...
Sep 04 15:41:34 nixos nginx[8992]: nginx: the configuration file /nix/store/ad08a69i5hxx24lcpw1rvrzzw6cf6jqd-nginx.conf syn>
Sep 04 15:41:34 nixos nginx[8992]: nginx: configuration file /nix/store/ad08a69i5hxx24lcpw1rvrzzw6cf6jqd-nginx.conf test is>
Sep 04 15:41:34 nixos systemd[1]: Reloaded Nginx Web Server.
Sep 04 15:47:39 nixos systemd[1]: Stopping Nginx Web Server...
Sep 04 15:47:39 nixos systemd[1]: nginx.service: Deactivated successfully.
Sep 04 15:47:39 nixos systemd[1]: Stopped Nginx Web Server.
Sep 04 15:47:39 nixos systemd[1]: Starting Nginx Web Server...
Sep 04 15:47:39 nixos nginx-pre-start[11087]: nginx: the configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-ngi>
Sep 04 15:47:39 nixos nginx-pre-start[11087]: nginx: configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-nginx.c>
Sep 04 15:47:39 nixos systemd[1]: Started Nginx Web Server.
Sep 04 15:47:39 nixos systemd[1]: Reloading Nginx Web Server...
Sep 04 15:47:40 nixos nginx[11157]: nginx: the configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-nginx.conf sy>
Sep 04 15:47:40 nixos nginx[11157]: nginx: configuration file /nix/store/wzsacg8w55pq0rq2n525pzc2lp0555sy-nginx.conf test i>
Sep 04 15:47:40 nixos systemd[1]: Reloaded Nginx Web Server.
Also seems fine.
I also have my Cloudflare proxy pointing to the public IP of my server. Maybe a port forwarding thing? The external ports are 80, 443 and eventually 22, but those might already be used.
1 Like
Have you verified that using the public IP on those ports works? I know you said you did it over LAN, but what about trying against the external address?
Make sure to disable any public IP blocking if you have any:
Got it working. Apparently the problem was using httpConfig instead of appendHttpConfig. It was expecting a lot of options.
Any idea why the argon2 generator isn’t working?
[mothmachine@nixos:/etc/nixos/secrets]$ $COPYPARTY_BIN --ah-alg argon2 --ah-gen 'autumni:MySecretPassword123!'
copyparty v1.20.21 "sftp is fine too" (2026-08-17)
CPython v3.14.7 on Linux64 [GCC 15.3.0]
sqlite 3.53.3*1 | jinja 3.1.6 | pyftpd 2.2.0 | tftp (None) | miko (None)
+usFJE_1RiNmRGgprP689Rv4CHpscKuiW
This should be in a diff. format.
1 Like
That seems like the format it should be outputting to me. What do format do you expect it to output?
It actually was the right format. However journalctl logs “WARN: invalid password: ‘%eN3IVVuxZ3_1r3W6’“ rather than my actual argon2-hashed passwd online. Clientside?
”testpass” = “+PLNUsVv0gnVtcr_UAc6ZHcnf63dVQ2ww”. weird
From Github issue, here is a journalctl log of the failed login
[mothmachine@nixos:~]$ journalctl -u copyparty -f --no-pager
Sep 14 14:06:25 nixos copyparty[44529]: 14:06:25.513 up2k LOG: reload #2502 running
Sep 14 14:06:25 nixos copyparty[44529]: 14:06:25.514 up2k LOG: 1 volumes in 0.00 sec
Sep 14 14:07:25 nixos copyparty[44529]: 14:07:25.514 up2k LOG: reload #2503 running
Sep 14 14:07:25 nixos copyparty[44529]: 14:07:25.515 up2k LOG: 1 volumes in 0.00 sec
Sep 14 14:08:25 nixos copyparty[44529]: 14:08:25.516 up2k LOG: reload #2504 running
Sep 14 14:08:25 nixos copyparty[44529]: 14:08:25.517 up2k LOG: 1 volumes in 0.00 sec
Sep 14 14:09:25 nixos copyparty[44529]: 14:09:25.516 up2k LOG: reload #2505 running
Sep 14 14:09:25 nixos copyparty[44529]: 14:09:25.517 up2k LOG: 1 volumes in 0.00 sec
Sep 14 14:10:25 nixos copyparty[44529]: 14:10:25.516 up2k LOG: reload #2506 running
Sep 14 14:10:25 nixos copyparty[44529]: 14:10:25.517 up2k LOG: 1 volumes in 0.00 sec
Sep 14 14:10:49 nixos copyparty[44529]: 14:10:49.131 xxxx 45700 LOG: GET / @*
Sep 14 14:10:49 nixos copyparty[44529]: 14:10:49.833 xxxx 45796 LOG: GET /?tree= @*
Sep 14 14:10:52 nixos copyparty[44529]: 14:10:52.062 xxxx 45820 LOG: GET /?h @*
Sep 14 14:10:52 nixos copyparty[44529]: 14:10:52.742 xxxx 45860 LOG: GET /favicon.ico @*
Sep 14 14:10:55 nixos copyparty[44529]: 14:10:55.954 xxxx 41798 LOG: POST / @*
Sep 14 14:10:55 nixos copyparty[44529]: 14:10:55.954 xxxx 41798 LOG: ‘Content-Disposition: form-data; name=“act”’
Sep 14 14:10:55 nixos copyparty[44529]: 14:10:55.954 xxxx 41798 LOG: ‘Content-Disposition: form-data; name=“cppwd”’
Sep 14 14:10:55 nixos copyparty[44529]: 14:10:55.954 xxxx 41798 LOG: ‘Content-Disposition: form-data; name=“uhash”’
Sep 14 14:10:55 nixos copyparty[44529]: 14:10:55.955 xxxx 41798 WARN: invalid password: ‘%eN3IVVuxZ3_1r3W6’
Sep 14 14:10:56 nixos copyparty[44529]: 14:10:56.300 xxxx 41802 LOG: GET /favicon.ico @*
Sep 14 14:10:56 nixos copyparty[44529]: 14:10:56.883 xxxx 41806 LOG: GET / @*
Sep 14 14:10:57 nixos copyparty[44529]: 14:10:57.279 xxxx 41812 LOG: GET /?tree= @*