A
A
Asparagales2019-02-12 17:39:18
Nginx
Asparagales, 2019-02-12 17:39:18

How to protect Nginx based proxy from unauthorized access?

I had an idea to take a VPS, install Nginx on it, and configure it as a proxy in order to access the Internet through it. More precisely, in any case, I will go to the Internet through the provider; I mean accessing the target resource through a proxy.
How can I ensure that only I and no one else can use this proxy? On the VPS with Nginx, 3 ports must be open - 22 (SHH) and 80, 443 (Nginx). I generally know how to protect SHH.
Is it possible to make the proxy pass only to certain sites and nowhere else? Is it possible to limit the range of IP addresses from which the proxy will accept an incoming connection? Is it possible to password protect the proxy so that only I can use it?
And where are the appropriate settings made - in the configuration of Nginx itself or in iptables or somewhere else?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Stanislav Bodrov, 2019-02-12
@jenki

Is it possible to make the proxy pass only to certain sites and nowhere else? Is it possible to limit the range of IP addresses from which the proxy will accept an incoming connection?
iptables settings
Is it possible to password protect the proxy so that only I can use it?
nginx password

F
fluffybear, 2019-02-12
@fluffybear

Isn't it easier to create a tunnel over ssh?
ssh -D 8888 -q -C -N [email protected]_vps
Then write the sock5 proxy localhost:8888 in the browser and your browser starts surfing the Internet through vps

K
ky0, 2019-02-12
@ky0

Yes, you can on all counts. Google, read mana - trivial questions.

G
Godless, 2019-02-13
@Godless

I had an idea to take a VPS, install Nginx on it, and configure it as a proxy in order to access the Internet through it.

In general, Nginx does not really exist for this. Unlike Squid or SOCKS5 as fluffybear wrote
ssh -D 8888 -q -C -N [email protected]_vps

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question