i2pd. Example Nginx config with Host header hack and basic auth.

This commit is contained in:
Alexey Skobkin 2022-03-13 05:04:49 +03:00
parent dd4f576e07
commit 9800dcaecd

25
i2pd/nginx/i2pd.conf Normal file
View file

@ -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;
}
}