localservices/templates/i2psnark/i2psnark_nginx.conf.j2

41 lines
1.2 KiB
Django/Jinja

# We need to use this as a proxy because allowing non local domains
# doese not work for i2pshark standalone...
server {
listen 8080;
server_name _;
# Redirect the root to the I2PSnark application.
location = / {
return 302 https://{{ localservices.i2psnark.url }}/i2psnark/;
}
location / {
proxy_pass http://i2psnark:8002;
proxy_http_version 1.1;
# I2PSnark requires localhost headers.
proxy_set_header Host 127.0.0.1;
proxy_set_header Origin http://127.0.0.1;
# Preserve HTTPS information.
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host {{ localservices.i2psnark.url }};
# Rewrite absolute redirects from the backend.
proxy_redirect http://127.0.0.1:8002/ https://{{ localservices.i2psnark.url }}/;
proxy_redirect http://127.0.0.1/ https://{{ localservices.i2psnark.url }}/;
# Forward client information.
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Support longer-running requests.
proxy_connect_timeout 60s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
proxy_buffering off;
}
}