3 Reverse_Proxy
Christian Voigt edited this page 3 months ago

This is my nginx configuration for running the bot and allocs webmap off of sub-domains. I've ran into some snags while checking this out, added lines and removed them while testing. Not sure if they are all needed, but yeah, this is what I ended up with:

server {
    server_name pvecw.chrani.net;

    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header Origin "";

        proxy_pass http://127.0.0.1:26905/;
    }
}
server {
    server_name map.pvecw.chrani.net;

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;

    location / {
        proxy_pass http://127.0.0.1:26903/;
    }
}

This will NOT make flask more performant, you will still need the uwsgi option, I haven't figured that stuff out yet. But at least you can make all this look good and also add encryption / https without much trouble at all.

This will require you to set the server_name option in ~/chrani-bot-tng/bot/options/module_webserver.json