Torify Neocities
23 August 2025
how to "torify" your neocities page with an nginx reverse proxy
inconsequential disclaimer: i have no idea if neocities is okay with this, but there is no obvious reason for me to believe they should care
what is this about?
the onion router project allows internet users to access various services through multiple layers of encryption and pseudonymity for free. tor browser allows mere mortals to browse the web with reasonable protection fairly easily, and the tor daemon gives system administrators an extremely easy way to provide most types of internet services without revealing a server's ip address at all
when a tor user connects to a hidden service, the user is additionally protected in that the administrator cannot see where the user is coming from at all - all incoming connections appear to be coming from localhost
motive
because i am very autistic about tor, i took the time to proxy my own page through a hidden service on one of my personal servers. you may have a more practical reason, though. maybe you're running a privacy page or esoteric variety blog whose users may want more than one way to visit you
prerequisites (hope you like terminals buddy)
you will need a device running nginx and tor. you can run this at home or anywere, really. no port forwarding necessary. additionally this device can be a pc, server, raspberry pi, whatever really. on most linux machines, you can install the packages tor
and nginx
with your system's own package manager. enable their respective services from your init system (i.e. sudo systemctl enable ...
+ sudo systemctl start ...
on ubuntu, fedora, pop os, raspbian, the like)
for fedora, you must first create the file /etc/yum.repos.d/tor.repo
with the following contents:
[tor]
name=Tor for Fedora $releasever - $basearch
baseurl=https://rpm.torproject.org/fedora/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.torproject.org/fedora/public_gpg.key
cost=100
...and then you can install the tor package with dnf
. (and while you're at it, use a real operating system like mint or devuan)
configuration
you're gonna wanna grow yourself a tasty little onion. either devise a silly one through esoteric wizardry or just let tor do it for you. im going to show you how to let tor do it for you. create the file /etc/tor/torrc
(if it already exists, move it to /etc/tor/torrc.backup
or something before making your new one i guess). make it look like this:
HiddenServiceDir /var/lib/tor/neocities-tor
HiddenServicePort 80 unix:/var/run/neocities-tor.sock
next time the tor service is restarted, it will create an onion and point it to a socket. we will create that socket in a second, but first you should restart tor and get your bloomin' onion
restart the tor
service, i.e. sudo systemctl restart tor.service
on systemd-based machines. i will continue with systemctl
examples because i assume that people on non-systemd operating systems do not need this kind of handholding
if everything works so far, run sudo cat /var/lib/tor/neocities-tor/hostname
and copy the output to your clipboard. that is your onion address for this service. you'll need it for the rest of this
now you need to add something like this to your nginx
configuration. i recommend creating a separate file somewhere like /etc/nginx/neocities-tor.conf
server {
listen unix:/var/run/neocities-tor.sock;
server_name yoursiteabcdefghijklmnopqrstuvwxyz7777777777777777777777.onion; # replace with your onion from /var/lib/tor/neocities/hostname
location / {
proxy_pass https://YOURSITE.neocities.org;
sub_filter_once off;
sub_filter 'https://YOURSITE.neocities.org/' 'http://yoursiteabcdefghijklmnopqrstuvwxyz7777777777777777777777.onion';
}
}
if you created a new file, add the line include /etc/nginx/neocities-tor.conf;
to the http {}
block in /etc/nginx/nginx.conf
spinning up
if you did everything right (and i didn't completely fuck this tutorial up), you should be ready to restart nginx now
example on fedora (lol):
sudo systemctl restart tor.service
sudo systemctl restart nginx.service
put a little bow on it
you can put anywhere on your page that you have an onion for your site now, but i prefer to be more discreet
now we're gonna make it so tor browser notifies users of your onion when they are on your neocities webpage. add the following to the <head></head>
section of /index.html
:
<meta http-equiv="onion-location" content="http://yoursiteabcdefghijklmnopqrstuvwxyz7777777777777777777777.onion/">
save your neocities page and take a look at it through Tor Browser
if you see that little purple button, go ahead and click it
expect things to be slow; you're behind several proxies and you're not paying a cent
congratulations, your neocities can now be accessed anonymously through tor
if i fucked it up or you have questions shoot me an email at lucke at waifu dot club. i hope that these instructions were clear enough for a beginner or near-intermediate linux user