From 9800dcaecd8485b66375f7d68d504cfda280e682 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sun, 13 Mar 2022 05:04:49 +0300 Subject: [PATCH] i2pd. Example Nginx config with Host header hack and basic auth. --- i2pd/nginx/i2pd.conf | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 i2pd/nginx/i2pd.conf diff --git a/i2pd/nginx/i2pd.conf b/i2pd/nginx/i2pd.conf new file mode 100644 index 0000000..7900af5 --- /dev/null +++ b/i2pd/nginx/i2pd.conf @@ -0,0 +1,25 @@ +server { + listen 80; + server_name i2p.domain.tld; + + #charset utf-8; + + location / { + #proxy_set_header Host $host; + # DO NOT USE THIS IF YOU DON'T KNOW WHAT YOU'RE DOING! + # Here we're replacing host by 'localhost' to avoid getting 'host mismatch' error and be able to proxy i2pd. + proxy_set_header Host 'localhost'; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_read_timeout 600s; + proxy_send_timeout 600s; + + proxy_pass http://127.0.0.1:7070/; + + # We need to protect i2pd control panel + auth_basic "Restricted access"; + auth_basic_user_file /path/to/.htpasswd; + } +} \ No newline at end of file