server { listen 127.0.0.1:8000; # Here we will listen for incoming from I2P connections #server_name .b32.i2p .i2p; # We receive any domain, so that option is commented access_log /dev/null; error_log /dev/null warn; add_header X-Frame-Options 'SAMEORIGIN'; add_header X-Xss-Protection '1; mode=block'; add_header X-Content-Type-Options 'nosniff'; root /path/to/webogram-i2p/dist; index index.html; charset utf8; sub_filter_once off; sub_filter_last_modified on; sub_filter_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/javascript application/json application/xml+rss; location / { try_files $uri $uri/ /index.html; sub_filter "https://web.telegram.org/" "http://$server_name/"; } proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; # TODO: do it better! location /web/venus/ { proxy_pass https://venus.web.telegram.org/; } location /web/venus-1/ { proxy_pass https://venus-1.web.telegram.org/; } location /web/pluto/ { proxy_pass https://pluto.web.telegram.org/; } location /web/pluto-1/ { proxy_pass https://pluto-1.web.telegram.org/; } location /web/vesta/ { proxy_pass https://vesta.web.telegram.org/; } location /web/vesta-1/ { proxy_pass https://vesta-1.web.telegram.org/; } location /web/aurora/ { proxy_pass https://aurora.web.telegram.org/; } location /web/aurora-1/ { proxy_pass https://aurora-1.web.telegram.org/; } location /web/flora/ { proxy_pass https://flora.web.telegram.org/; } location /web/flora-1/ { proxy_pass https://flora-1.web.telegram.org/; } }