https://it-notes.dragas.net/2025/01/29/improving-snac-performance-with-nginx-proxy-cache/
nginx
https://it-notes.dragas.net/2025/01/29/improving-snac-performance-with-nginx-proxy-cache/
⁂ Postawiłem sobie dzisiaj pl-fe od Nicole @mkljczk dla mojego #GoToSocial Fedika.pl
Z małym zgrzytem. #Nginx wymagał drobnej korekty location. To pomyślałem że podzielę się, bo może ktoś się odbije od tego samego. Tu akurat domyślna konfiguracja nginx w #YunoHost-owej apce "My webapp" nie zadziałała. Wyskakiwały 404 przy logowaniu do domeny instancji.
Domyślne location było:
try_files $uri $uri/ /index.php?$args =404;
a powinien być dodany index.html, bo to przecież #SPA / #PWA:
try_files $uri $uri/ /index.html =404;
Niniejszym macie receptę jak do swoich GtSów na YunoHost dodać własne #plfe.
Polecam, to najlepszy klient webowy i na telefon 👍
P.S. Zacznę chyba nazywać #NicoleFE bo mi się pl-fe średnio podoba 😉
Anyone else use NGINX Proxy Manager in their homelab? I’ve had some real issues with caching enabled on some self hosted fedi apps.
#NGINX: An 18-year-old RCE vulnerability CVE-2026-42945 in the rewrite module enables server takeover. Update to NGINX 1.31.0 or 1.30.1 immediately!
👇
https://thehackernews.com/2026/05/18-year-old-nginx-rewrite-module-flaw.html
Dear fellow or potential fellow gotosocial instance admins,
I've come up with a novel way to set up a #gotosocial server behind a reverse proxy, which avoids the use of making new firewalling rules - both on a VPS, and creating port forwarding on one's home router. This method is ideal for minimizing the cost of running one's own #ActivityPub/#Mastodon server, in a way that leverages inexpensive fast storage on the backend (say, on a #RaspberryPi 5, 2GB of RAM, with an NVMe). As many valiant and praiseworthy Mastodon server admins might attest to, renting cloud VPS' can cost a lot, especially when storing many tens or hundreds of GB of user data.
My method avoids the need of forwarding ports 443 and 80 into one's home LAN, using DNAT (on the VPS) and port forwarding (on one's home router). In a nutshell, it's a novel use of #Wireguard, in conjunction with #nginx on the frontend, and gotosocial on the backend. This can save the cost of renting a dedicated VPS, to get the exclusive use of ports 443 and 80, in conjunction with static IPv4 and IPv6 addresses. My method optimizes on reliability and cheapness, but it's not the most secure - decryption and re-encryption happens on the VPS, before the data travels down the Wireguard tunnel. This exposes the data to any underlying hypervisor at one's hosting company. So full disclosure there.
I've run my method by the helpful gotosocial furries in their #Matrix Help chatroom (and I'm grateful for their help to debug subtle warts the method had), and got their blessing, at least to the technical soundness of the method.
I have a testing instance of gotosocial 0.21.0 set up with this new method: https://g.toque.im
I'm the user @owl on that instance, should you wish to befriend me there.
I'll make a longer blog post on this in the days to come, and post it in a reply to this post. (I also cross-posted this on another account of mine, please forgive the duplicate: @gtsadmin )
#DevOps #Linux #infosec #SelfHosting #DataSovereignty #OpenSource
🎬 Skryptowanie nginx-a za pomocą js-a. Case study na rzecz wydajności i prywatności
@kuba z Fundacji @icd pokazuje, jak wykorzystać #JavaScript do skryptowania #NGINX oraz jak ta technika może poprawić wydajność i zwiększyć prywatność użytkowników.
👉 PeerTube: https://tube.pol.social/w/2BbPBaXKQU1c2QCEThGQNR
👉 YouTube: https://www.youtube.com/watch?v=O8wkSDxssLw
#PIWO #PIWO2025 #opensource #freesoftware #prywatność #poznań
Une faille vieille de 18 ans dans Nginx, un PoC public, beaucoup de bruit… mais qui est vraiment concerné ?
Sooooo my recent mishaps with server administration are making me speed up my plans of shifting towards community-owned and -maintained hosting.
Ever since my conversation with @boris almost one year ago, I took his quote “self-hosting is selfish” as a mantra. It’s time to act accordingly.
Together with @Holly and @youjungnoh, we are putting together a group of tech-savy people who want to, respectively:
- Learn more about system administration
- Get their hands dirty while doing so
- Maintain our own shared server
- Host their own things (be them websites, projects, or services) together with comrades instead of individual infrastructure.
There are many super cool collectives that are doing this already, and we intend to draw inspiration from their work and their documentation, but we really want to do this together!
Who wants to join? Please, do reach out! I already spun up a small-ish VPS that is now hosting all my static websites. If you’d like to get involved, reach out and I would be happy to give you SSH access 🌻
We would also be very grateful if more experienced sysAds want to help us out by hosting workshops or brief classes.
We intend to meet for the first time in South Holland (but maybe virtually too) sometime during the first two weeks of March.
Next steps:
- Find a name for this group/server/mission
- Plan a series of (free, open) intro lessons with guests
- Start hosting some things
- Migrate things I am already hosting with YunoHost in our community server
- Migrate to a physical device in a home of ours?
EDIT: I forgot to add this, but it goes without saying that ours would be a queer and transfeminist server
#communityHosting #Linux #sysAd #systemAdministration #selfHosting #YunoHost #Nginx #hosting #server #VPS
My #StarterPack for #Linux #SelfHosting
1) Heimdall start page for your LAN
2) Shiori bookmarks
3) Copyparty for filesharing through web or FTP
4) Kanboard Kanban board
5) Kiwix for offline website content
6) calibre-web for ebooks
7) Hyper8 for self-hosted video content, like a poor man's #Youtube.
8) mkdocs for a markdown-based wiki
I self-host all of these, using #nginx as the web server in all cases. These all consume very little RAM and CPU, and would run very performantly on a Raspberry Pi 5 2GB, with a decent SSD. No #docker needed for any of them.
#OpenSource #DataSovereignty
Quick heads-up for other Mastodon admins: this registration spam wave isn't over yet.
On lsbt.me, we first saw a flood of API registrations using Python/aiohttp. The telltale signs were usernames following the pattern bp plus 16 hex characters, and the sign-up reason was always "Automated protocol deliverability probe". A narrow block on that user agent stopped the first wave.
Today, however, five new registrations came in with the same usernames and the same sign-up reason. This time the bot simply identified itself as Chrome 126. That's exactly why a user agent is only useful as a short-term filter. It's a header the client can set to anything.
The requests go to POST /api/v1/accounts. This endpoint lets client apps create a new local account directly in the app. No app needs it for OAuth connections to existing accounts. #FediSuite doesn't use it either. It registers itself via /api/v1/apps, obtains consent via /oauth/authorize, and then works with a user token. Regular sign-up through the Mastodon website is also handled separately via POST /auth.
So I've completely disabled API account creation on lsbt.me. Web sign-up, OAuth, and existing clients keep working as before. Anyone who wants a new account just signs up once on the web as usual and can then use any client.
If you'd also rather not offer this optional native sign-up path, you can add the following to your Nginx server block, before the general location / block. The example assumes the @proxy location that many Mastodon Nginx configs already include:
location = /api/v1/accounts {
limit_except GET {
deny all;
}
try_files $uri @proxy;
}
This returns a 403 only for POST /api/v1/accounts. The read-only GET endpoint remains reachable. As always, run nginx -t afterwards and only reload once the test passes.
#Mastodon #Fediverse #MastoAdmin #FediAdmin #FediMod #FediBlock #Moderation #Registration #Spam #Nginx #SelfHosting #SysAdmin #ActivityPub
littleFedi: reverse proxy and split domains
littleFedi can use one domain for account handles and another for the server. For example:
@alice@example.comis the address people follow.https://social.example.comserves the web interface, API, media and ActivityPub objects.
You can keep your existing website on example.com. It only needs a rule that redirects WebFinger requests to the littleFedi domain.
Choose both domains before creating accounts. Changing them later changes the instance’s identity.
littleFedi configuration
In littlefedi.toml, with the reverse proxy running on the same machine:
local_domain = "example.com"
web_domain = "social.example.com"
[http]
listen = "127.0.0.1:8080"
proxy_uri = "https://social.example.com"
trusted_proxies = ["127.0.0.1/32"]
If you already have an [http] section, edit it rather than adding another.
Point the DNS records for social.example.com at the reverse proxy. The server hosting example.com must also serve HTTPS. A DNS alias alone does not replace the WebFinger redirect.
Expose ports 80 and 443 on the proxy and keep port 8080 private. If the proxy runs on another machine, use a private listener address and trust only the proxy’s address.
Caddy
Add this to your Caddyfile, replacing the example domains:
social.example.com {
reverse_proxy 127.0.0.1:8080
}
example.com {
redir /.well-known/webfinger https://social.example.com{uri} 302
}
Caddy handles certificates and the WebSocket connections used for streaming.
If example.com already has a site block, add only the redir line to that block and keep the existing website configuration.
Check the configuration before reloading Caddy:
caddy validate --config /etc/caddy/Caddyfile
nginx
This configuration belongs in nginx’s http context, usually through an included site file. Replace the domains and certificate paths with your own.
Install valid certificates and arrange automatic renewal before enabling the HTTPS servers.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name example.com social.example.com;
return 308 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name social.example.com;
ssl_certificate /etc/letsencrypt/live/social.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/social.example.com/privkey.pem;
client_max_body_size 41m;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 1h;
proxy_buffering off;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
location = /.well-known/webfinger {
return 302 https://social.example.com$request_uri;
}
location / {
return 404;
}
}
If example.com already hosts a website, add only the WebFinger location to its existing HTTPS server block. Keep the website’s other rules instead of the return 404 shown above. If you already have the same map directive, do not add it twice.
Check the configuration before reloading nginx:
nginx -t
Check discovery
Use an existing local account, replacing alice with its username:
curl --fail -i 'https://example.com/.well-known/webfinger?resource=acct:alice@example.com'
The response should redirect to social.example.com, keeping the resource query parameter.
Then follow the redirect:
curl --fail -L 'https://example.com/.well-known/webfinger?resource=acct:alice@example.com'
The JSON should contain acct:alice@example.com as its subject, with an ActivityPub actor link at https://social.example.com/users/alice.
Finally, check a follow in both directions with another instance.
If account handles and the server use the same domain, only the reverse proxy is needed.
BREAKING: Two critical Nginx flaws in the HTTP/2 implementation let an unauthenticated attacker run code on the server. CVE-2026-123633 and CVE-2026-123007. Both have scored an astonishingly high score of CVSS 9.2 and researchers have demonstrated RCE and code execution that gets past ASLR. Researchers got RCE against a server which served only static files.
One of these vulnerabilities of Nginx existed since 2015. The other one for nearly 6 years. Nginx runs more than 225 million websites online albeit not all are vulnerable but most are. The primary requirement is to have HTTP/2 enabled. Also, each flaw has additional conditions.
Several research teams have found them independently. Nginx has released fixes in the versions 1.30.7 and 1.31.9. If you cannot patch and update right now, the only stopgap mitigation is disabling HTTP/2. Some have touted it as Nginx2Root.
Full technical analysis, exploitation details, affected versions and mitigation steps: https://thecybersecguru.com/exploits/nginx-http2-vulnerability-cve-2026-123633-123007/
#PSA: If you are hosting a #GitLab instance, you should know that version 19.6.0, released yesterday, still contained a vulnerable Ruby version.
GitLab version 19.6.1, released today, fixed Ruby but still contains a vulnerable #nginx version (1.31.7).
So if you have to use GitLab's bundled webserver nginx, you should at least disable #http2 and TLS1.3:
🐘