I have server with Centos 7 and pptpd, httpd installed. httpd works well and pptpd server has working connections so it works well too. Actually what I need is to make httpd site available only through pptp vpn. I've tried to use these answers but no luck. php $_SERVER['REMOTE_ADDR'] gives me the same ip when I visit site with or without vpn.
upd:
iptables -A INPUT -i ! ppp+ -p tcp --dport <protected-port> -j REJECT
gives me Bad argument 'ppp+'
Then I wrote iptables rules to block all requests to <protected-port>
and allow only ppp+ packets. But seems like it doesn't work too.
All I need is just to have vpn and httpd on the same server and web site available only for vpn connections. And I need it for http and https.