The original post: /r/nginx by /u/succulent_samurai on 2024-12-08 18:01:53.

Hey all, I’m trying to host a Terraria server using Tshock and using nginx as a reverse proxy (basically the goal is to allow people to connect to my server using terraria.mywebsite.com so I don’t have to give out my IP address). Tshock works if I connect to it using my IP address, so I know the server works fine. But when I use my domain, the game gets to the “found server” step and then just sits there forever. This makes me think that there’s an issue somewhere between nginx and tshock when tshock tries to send data back to nginx, but I’m not super familiar with reverse proxies so I could have this wrong.

Here’s my nginx.conf file:

server {

listen 80;

server_name terraria.mywebsite.com;

location / {

proxy_pass http://localhost:7777/;

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 Accept-Encoding "";

}

}

Nginx logs have some alerts about “*9 open socket #18 left in connection 8” which I don’t know what that means.

And I’ve tried connecting on both ports 80 and 443 from terraria to no avail (I have nginx listening on 443 as well for https in case it’s needed).

Thanks in advance if anyone’s able to help!