I want to host a service, and then connect to it using a specific proxy when it is accessed via specific domain.
Like it's shown here:
| # User make a request to s2.example.com
|__ s2.example.com <-- This is my VPS that runs debian sid, nginx and some websites hosted on example.com
|
|__ nginx receive request, and use 127.0.0.1:9050 as socks5 proxy, and send request to elpmaxe.onion
|
|__ 127.0.0.1:9050 receive request, and redirect it to target elpmaxe.onion
|
|__ elpmaxe.onion receive request, and send response
// I know that this is going to cause delays in connection, but that's not a big problem.
To solve my problem I'd like to do something like this, but I just don't know how to use socks5 while doing proxy_pass.
location / {
# using socks5 proxy on 127.0.0.1:9050
proxy_pass http://elpmaxe.onion/;
}