Cant run tor webserver using unix sockets in Nginx (Rocky Linux & Ubuntu 22.04). No relevant log files

I am attempting to create a torrified server out of an already existing clearnet server. I started out on Ubuntu 22.04, but then switched to Rocky Linux after running into this problem.

Working config (Network Sockets):
torrc

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:80

Corresponding Working Nginx Virtual Hosts:

server {
    listen 127.0.0.1:80;
    server_name 7oau32e3zafhewonl25u6nygajwieyfa762d02hjj5xsjf6zf3fxqd.onion;
    root /var/www/hidden_service;
    access_log /var/log/nginx/hidden_service.access.log;
    error_log /var/log/nginx/hidden_service.error.log;
}

Broken Config (Unix Sockets):
torrc

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 unix:/var/run/tor-hidden-service.sock

Corresponding Broken Nginx Virtual Host:

server {
    listen unix:/var/run/tor-hidden-service.sock
    server_name 7oau32e3zafhewonl25u6nygajwieyfa762d02hjj5xsjf6zf3fxqd.onion;
    root /var/www/hidden_service;
    access_log /var/log/nginx/hidden_service.access.log;
    error_log /var/log/nginx/hidden_service.error.log;
}

I have successfully gotten the network sockets to work on both Ubuntu and Rocky linux, but am encountering the same problem with unix sockets on both OS’s. After switching to the unix sockets, no relevant logs are reported, and my previously working non-unix socket torrified site, now no longer works under unix sockets.

There isn’t much documentation on tor in general, and I can’t understand (especially without logs) where this issue is coming from. Can someone please help me get unix sockets working on a tor host? Thanks.

Anyone have any answers for me here?

Hello, still having issue? I had similar one, but managed to fix it :slight_smile: