jenchanws / create-track-map

Create train track map mod for Minecraft (Fabric & Forge)
https://modrinth.com/mod/create-track-map
MIT License
65 stars 19 forks source link

Allow configuration of the bind address #68

Open cyyynthia opened 6 months ago

cyyynthia commented 6 months ago

Describe the Suggestion

For my server I use a nginx proxy for all user-facing websites (including for example dynmap) and I'd like to also put the track map behind it. The rationale is that it a) allows me to access it via a clean URL without ports b) allows me to serve it via https c) reduces attack surface by having nginx sit in front of the internet (you never know when something gets a vulnerability!) d) allows me to set ratelimit rules, easier threat protection via fail2ban/crowdsec/....

Screenshots and Videos

No response

Additional Context

No response

centmeteenvin commented 3 months ago

I have a kind of way of setting up nginx to pass to the train maps but it is kind of ugly.

    location /train {
        # alias;
        proxy_pass http://localhost:3876/;
    }

    location /api {
        proxy_pass http://localhost:3876/$uri;
    }

    location /assets {
        proxy_pass http://localhost:3876/$uri;
    }

I am not the biggest fan of this solution as it consumes 3 location url's on the hostname. The reason I did this is, is because the scripts will call hostname/api and hostname/assets. If this can be fixed it would be nicer.