I ran the following iptables commands to start pptp server:

iptables -A INPUT -i venet0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i venet0 -p gre -j ACCEPT
iptables -A FORWARD -i ppp0 -o venet0 -j ACCEPT
iptables -A FORWARD -i venet0 -o ppp0 -j ACCEPT
iptables -t nat -A POSTROUTING -j SNAT --to-source

But it damaged the php-fpm service. Nginx returns an error “502 Bad Gateway”. Nginx error log tells

failed (104: Connection reset by peer) while reading response header from upstream, client:, request: "GET / HTTP/1.1", upstream: "fastcgi://"

php-fpm service is running normally

service php-fpm status
php-fpm (pid  14157) is running...

Could you advise me how to solve this problem?

  • Wait, I'm having difficulty to understand what are you trying to achieve. To run php-fpm behind nginx you do not need iptables rules, you can simply run php-fpm on localhost (or even on a unix socket). Moreover why do you want a pptp connection for? Also, what are your configs? – grochmal Aug 21 '16 at 18:52

I've found a solution.

I just needed to run the command

iptables -t nat -D POSTROUTING -j SNAT --to-source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.