From 8eab8ada15a32cba71970835cb8c7ee8a2bba6e8 Mon Sep 17 00:00:00 2001 From: gpkvt Date: Tue, 6 Jun 2023 23:02:29 +0200 Subject: [PATCH] Added nginx config --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 6c942cb..efbd593 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,35 @@ Or just run `python3 ./game.py` ## Use Open your browser and navigate to `http://localhost:5000` or whatever you configured as `bind` and `port` in your `config.ini`. + +## Reverse Proxy + +To run this game in an production environment it's strongly recommended to set up an reverse proxy upfront. + +### nginx + +Make sure you understand the config and replace the `location` and/or `proxy_pass` value if necessary. + +```nginx +location / { + proxy_pass http://127.0.0.1:5000/; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + client_max_body_size 32M; + proxy_redirect off; + proxy_intercept_errors off; + proxy_read_timeout 86400s; + proxy_ignore_client_abort on; + proxy_connect_timeout 120s; + + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; + + proxy_headers_hash_max_size 512; + proxy_buffering on; + proxy_cache_bypass $http_pragma $http_authorization $cookie_nocache; +} +```