502 Bad GatewayNginx returning 502 Bad GatewayNginx 502 Bad GatewayProxy (nginx) shows a Bad gateway...

Why did the Death Eaters wait to reopen the Chamber of Secrets?

Did I need a visa in 2004 and 2006?

Why didn't all the iron and heavier elements find their way to the center of the accretion disc in the early solar system?

Keeping track of theme when improvising

David slept with Bathsheba because she was pure?? What does that mean?

Which are the methodologies for interpreting Vedas?

Does WiFi affect the quality of images downloaded from the internet?

Are skill challenges an official option or homebrewed?

Why did Robert pick unworthy men for the White Cloaks?

Is it a good security practice to force employees hide their employer to avoid being targeted?

Can you open the door or die? v2

How do I type a hyphen in iOS 12?

How (un)safe is it to ride barefoot?

What did the 8086 (and 8088) do upon encountering an illegal instruction?

What publication claimed that Michael Jackson died in a nuclear holocaust?

Why would a home insurer offer a discount based on credit score?

Why is my Taiyaki (Cake that looks like a fish) too hard and dry?

Is it possible to have battery technology that can't be duplicated?

What do I need to do, tax-wise, for a sudden windfall?

How do I properly use a function under a class?

Is plausible to have subspecies with & without separate sexes?

As easy as Three, Two, One... How fast can you go from Five to Four?

About the paper by Buekenhout, Delandtsheer, Doyen, Kleidman, Liebeck and Saxl

How can religions without a hell discourage evil-doing?



502 Bad Gateway


Nginx returning 502 Bad GatewayNginx 502 Bad GatewayProxy (nginx) shows a Bad gateway errornginx proxy - 502 bad gatewayHow to create/setup vpn using only SSH?iptables - 2 Internetprovider - routing502 error Nginx with php5-fpmNginx connection refused error 111, bad gateway502 bad gateway on nginxnginx - uwsgi - python bad gateway 502 when using port 80






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















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 33.122.21.177


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: 199.239.99.13, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"


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?










share|improve this question














bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • 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


















1















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 33.122.21.177


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: 199.239.99.13, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"


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?










share|improve this question














bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • 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














1












1








1








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 33.122.21.177


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: 199.239.99.13, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"


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?










share|improve this question














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 33.122.21.177


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: 199.239.99.13, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"


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?







centos iptables nginx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 21 '16 at 18:39









alexalex

62




62





bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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



















  • 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

















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





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










1 Answer
1






active

oldest

votes


















0














I've found a solution.



I just needed to run the command



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





share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f304842%2f502-bad-gateway%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I've found a solution.



    I just needed to run the command



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





    share|improve this answer




























      0














      I've found a solution.



      I just needed to run the command



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





      share|improve this answer


























        0












        0








        0







        I've found a solution.



        I just needed to run the command



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





        share|improve this answer













        I've found a solution.



        I just needed to run the command



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






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 21 '16 at 20:45









        romvladsromvlads

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f304842%2f502-bad-gateway%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...