Nginx upgrade to 1.8 - Now getting 502 bad gatewayNginx 1.6.3 to 1.8 upgradeBlank Page: wordpress on nginx+php-fpmNginx gives 504 Gateway Time-out once moved to livephpmyadmin having problems on nginx and php-fpm on RHEL 6Nginx: Bad Gateway 502 errorNGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404NginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL's

What dog breeds survive the apocalypse for generations?

How do I adjust encounters to challenge my lycanthrope players without negating their cool new abilities?

Was this seat-belt sign activation standard procedure?

Are there any sonatas with only two sections?

Developers demotivated due to working on same project for more than 2 years

Can I say: "When was your train leaving?" if the train leaves in the future?

Were any of the books mentioned in this scene from the movie Hackers real?

Why doesn't Iron Man's action affect this person in Endgame?

Can only the master initiate communication in SPI whereas in I2C the slave can also initiate the communication?

Why did the soldiers of the North disobey Jon?

Is Valonqar prophecy unfulfilled?

Why weren't the bells paid heed to in S8E5?

Substring join or additional table, which is faster?

How to make a not so good looking person more appealing?

How can I add a .pem private key fingerprint entry to known_hosts before connecting with ssh?

How to expose REST API to external users -- how do they authenticate and authorize to create lead in Salesforce

When does the attacker choose the damage type dealt by a weapon with multiple damage options?

Was the dragon prowess intentionally downplayed in S08E04?

How about space ziplines

Do Grothendieck universes matter for an algebraic geometer?

How can we allow remote players to effectively interact with a physical tabletop battle-map?

Why didn't the Avengers use this object earlier?

Extract the characters before last colon

Why was my Canon Speedlite 600EX triggering other flashes?



Nginx upgrade to 1.8 - Now getting 502 bad gateway


Nginx 1.6.3 to 1.8 upgradeBlank Page: wordpress on nginx+php-fpmNginx gives 504 Gateway Time-out once moved to livephpmyadmin having problems on nginx and php-fpm on RHEL 6Nginx: Bad Gateway 502 errorNGINX don't parse .php5 as .phpLaravel 4.1 on nginx routes error 404NginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL's






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Today I upgraded my localhost server from nginx 1.6.3 to 1.8.0 and now all my local websites are getting a 502 bad gateway.



A standard nginx config file is as follows



server svn


The error message I'm getting is as follows



2015/05/12 14:09:21 [error] 9295#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: yii2.dive, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "yii2.dive"


The socket at /var/run/php5-fpm.sock exists so there is no problem there.



I found someone else with a problem on the same upgrade but their issue is different to mine and not getting any errors.



I tried adding this line to /etc/nginx/fastcgi_params but it does not alleviate the problem.



fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


Alternatively is there a way to downgrade back to 1.6.2 or 1.6.3 and I can deal with this upgrade at a later date. I tried running



sudo apt-get install nginx=1.6.2-1+trusty0


But got the following error



The following packages have unmet dependencies:
nginx : Depends: nginx-full (< 1.6.2-1+trusty0.1~) but 1.8.0-1+trusty1 is to be installed or
nginx-light (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-extras (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-naxsi (< 1.6.2-1+trusty0.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.









share|improve this question
























  • What are the contents of php-fpm error.log?

    – Tero Kilkanen
    May 12 '15 at 18:40











  • There is nothing regarding errors. Only two lines from the last couple of days in /var/log/php5-fpm.log [12-May-2015 09:48:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [13-May-2015 09:11:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

    – mr mojo risin
    May 13 '15 at 8:37






  • 1





    Ultimately it turned out the problem was most likely with php5-fpm... Unfortunately I'm not entirely sure what was the underlying issue but after reinstalling both php5-fpm and nginx I was able to access my sites locally.

    – mr mojo risin
    May 20 '15 at 12:47


















1















Today I upgraded my localhost server from nginx 1.6.3 to 1.8.0 and now all my local websites are getting a 502 bad gateway.



A standard nginx config file is as follows



server svn


The error message I'm getting is as follows



2015/05/12 14:09:21 [error] 9295#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: yii2.dive, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "yii2.dive"


The socket at /var/run/php5-fpm.sock exists so there is no problem there.



I found someone else with a problem on the same upgrade but their issue is different to mine and not getting any errors.



I tried adding this line to /etc/nginx/fastcgi_params but it does not alleviate the problem.



fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


Alternatively is there a way to downgrade back to 1.6.2 or 1.6.3 and I can deal with this upgrade at a later date. I tried running



sudo apt-get install nginx=1.6.2-1+trusty0


But got the following error



The following packages have unmet dependencies:
nginx : Depends: nginx-full (< 1.6.2-1+trusty0.1~) but 1.8.0-1+trusty1 is to be installed or
nginx-light (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-extras (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-naxsi (< 1.6.2-1+trusty0.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.









share|improve this question
























  • What are the contents of php-fpm error.log?

    – Tero Kilkanen
    May 12 '15 at 18:40











  • There is nothing regarding errors. Only two lines from the last couple of days in /var/log/php5-fpm.log [12-May-2015 09:48:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [13-May-2015 09:11:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

    – mr mojo risin
    May 13 '15 at 8:37






  • 1





    Ultimately it turned out the problem was most likely with php5-fpm... Unfortunately I'm not entirely sure what was the underlying issue but after reinstalling both php5-fpm and nginx I was able to access my sites locally.

    – mr mojo risin
    May 20 '15 at 12:47














1












1








1


1






Today I upgraded my localhost server from nginx 1.6.3 to 1.8.0 and now all my local websites are getting a 502 bad gateway.



A standard nginx config file is as follows



server svn


The error message I'm getting is as follows



2015/05/12 14:09:21 [error] 9295#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: yii2.dive, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "yii2.dive"


The socket at /var/run/php5-fpm.sock exists so there is no problem there.



I found someone else with a problem on the same upgrade but their issue is different to mine and not getting any errors.



I tried adding this line to /etc/nginx/fastcgi_params but it does not alleviate the problem.



fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


Alternatively is there a way to downgrade back to 1.6.2 or 1.6.3 and I can deal with this upgrade at a later date. I tried running



sudo apt-get install nginx=1.6.2-1+trusty0


But got the following error



The following packages have unmet dependencies:
nginx : Depends: nginx-full (< 1.6.2-1+trusty0.1~) but 1.8.0-1+trusty1 is to be installed or
nginx-light (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-extras (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-naxsi (< 1.6.2-1+trusty0.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.









share|improve this question
















Today I upgraded my localhost server from nginx 1.6.3 to 1.8.0 and now all my local websites are getting a 502 bad gateway.



A standard nginx config file is as follows



server svn


The error message I'm getting is as follows



2015/05/12 14:09:21 [error] 9295#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: yii2.dive, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "yii2.dive"


The socket at /var/run/php5-fpm.sock exists so there is no problem there.



I found someone else with a problem on the same upgrade but their issue is different to mine and not getting any errors.



I tried adding this line to /etc/nginx/fastcgi_params but it does not alleviate the problem.



fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


Alternatively is there a way to downgrade back to 1.6.2 or 1.6.3 and I can deal with this upgrade at a later date. I tried running



sudo apt-get install nginx=1.6.2-1+trusty0


But got the following error



The following packages have unmet dependencies:
nginx : Depends: nginx-full (< 1.6.2-1+trusty0.1~) but 1.8.0-1+trusty1 is to be installed or
nginx-light (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-extras (< 1.6.2-1+trusty0.1~) but it is not going to be installed or
nginx-naxsi (< 1.6.2-1+trusty0.1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.






nginx php-fpm upgrade






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:14









Community

1




1










asked May 12 '15 at 13:27









mr mojo risinmr mojo risin

10613




10613












  • What are the contents of php-fpm error.log?

    – Tero Kilkanen
    May 12 '15 at 18:40











  • There is nothing regarding errors. Only two lines from the last couple of days in /var/log/php5-fpm.log [12-May-2015 09:48:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [13-May-2015 09:11:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

    – mr mojo risin
    May 13 '15 at 8:37






  • 1





    Ultimately it turned out the problem was most likely with php5-fpm... Unfortunately I'm not entirely sure what was the underlying issue but after reinstalling both php5-fpm and nginx I was able to access my sites locally.

    – mr mojo risin
    May 20 '15 at 12:47


















  • What are the contents of php-fpm error.log?

    – Tero Kilkanen
    May 12 '15 at 18:40











  • There is nothing regarding errors. Only two lines from the last couple of days in /var/log/php5-fpm.log [12-May-2015 09:48:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [13-May-2015 09:11:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

    – mr mojo risin
    May 13 '15 at 8:37






  • 1





    Ultimately it turned out the problem was most likely with php5-fpm... Unfortunately I'm not entirely sure what was the underlying issue but after reinstalling both php5-fpm and nginx I was able to access my sites locally.

    – mr mojo risin
    May 20 '15 at 12:47

















What are the contents of php-fpm error.log?

– Tero Kilkanen
May 12 '15 at 18:40





What are the contents of php-fpm error.log?

– Tero Kilkanen
May 12 '15 at 18:40













There is nothing regarding errors. Only two lines from the last couple of days in /var/log/php5-fpm.log [12-May-2015 09:48:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [13-May-2015 09:11:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

– mr mojo risin
May 13 '15 at 8:37





There is nothing regarding errors. Only two lines from the last couple of days in /var/log/php5-fpm.log [12-May-2015 09:48:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [13-May-2015 09:11:22] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

– mr mojo risin
May 13 '15 at 8:37




1




1





Ultimately it turned out the problem was most likely with php5-fpm... Unfortunately I'm not entirely sure what was the underlying issue but after reinstalling both php5-fpm and nginx I was able to access my sites locally.

– mr mojo risin
May 20 '15 at 12:47






Ultimately it turned out the problem was most likely with php5-fpm... Unfortunately I'm not entirely sure what was the underlying issue but after reinstalling both php5-fpm and nginx I was able to access my sites locally.

– mr mojo risin
May 20 '15 at 12:47











2 Answers
2






active

oldest

votes


















0














This works for me



replace



include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;


with



include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;





share|improve this answer























  • In which file you had made this changes, kindly give the path of file?

    – Tarunn
    Jul 12 '15 at 18:51











  • In your vhost file

    – zourite
    Jul 13 '15 at 1:19











  • Doesn't work. Same result.

    – PKHunter
    Feb 9 '16 at 14:53


















0














Remove all nginx packets with:



aptitude purge nginx nginx-full


Than add official nginx deb repos:



deb http://nginx.org/packages/debian/ codename nginx
deb-src http://nginx.org/packages/debian/ codename nginx

wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key


Finally install nginx:



apt-get update
apt-get install nginx


https://nginx.org/en/linux_packages.html



It should work now. If not - see /var/log/nginx/error.log and fix errors.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fserverfault.com%2fquestions%2f691428%2fnginx-upgrade-to-1-8-now-getting-502-bad-gateway%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    This works for me



    replace



    include fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;


    with



    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;





    share|improve this answer























    • In which file you had made this changes, kindly give the path of file?

      – Tarunn
      Jul 12 '15 at 18:51











    • In your vhost file

      – zourite
      Jul 13 '15 at 1:19











    • Doesn't work. Same result.

      – PKHunter
      Feb 9 '16 at 14:53















    0














    This works for me



    replace



    include fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;


    with



    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;





    share|improve this answer























    • In which file you had made this changes, kindly give the path of file?

      – Tarunn
      Jul 12 '15 at 18:51











    • In your vhost file

      – zourite
      Jul 13 '15 at 1:19











    • Doesn't work. Same result.

      – PKHunter
      Feb 9 '16 at 14:53













    0












    0








    0







    This works for me



    replace



    include fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;


    with



    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;





    share|improve this answer













    This works for me



    replace



    include fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;


    with



    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 23 '15 at 13:49









    zouritezourite

    11




    11












    • In which file you had made this changes, kindly give the path of file?

      – Tarunn
      Jul 12 '15 at 18:51











    • In your vhost file

      – zourite
      Jul 13 '15 at 1:19











    • Doesn't work. Same result.

      – PKHunter
      Feb 9 '16 at 14:53

















    • In which file you had made this changes, kindly give the path of file?

      – Tarunn
      Jul 12 '15 at 18:51











    • In your vhost file

      – zourite
      Jul 13 '15 at 1:19











    • Doesn't work. Same result.

      – PKHunter
      Feb 9 '16 at 14:53
















    In which file you had made this changes, kindly give the path of file?

    – Tarunn
    Jul 12 '15 at 18:51





    In which file you had made this changes, kindly give the path of file?

    – Tarunn
    Jul 12 '15 at 18:51













    In your vhost file

    – zourite
    Jul 13 '15 at 1:19





    In your vhost file

    – zourite
    Jul 13 '15 at 1:19













    Doesn't work. Same result.

    – PKHunter
    Feb 9 '16 at 14:53





    Doesn't work. Same result.

    – PKHunter
    Feb 9 '16 at 14:53













    0














    Remove all nginx packets with:



    aptitude purge nginx nginx-full


    Than add official nginx deb repos:



    deb http://nginx.org/packages/debian/ codename nginx
    deb-src http://nginx.org/packages/debian/ codename nginx

    wget http://nginx.org/keys/nginx_signing.key
    sudo apt-key add nginx_signing.key


    Finally install nginx:



    apt-get update
    apt-get install nginx


    https://nginx.org/en/linux_packages.html



    It should work now. If not - see /var/log/nginx/error.log and fix errors.






    share|improve this answer





























      0














      Remove all nginx packets with:



      aptitude purge nginx nginx-full


      Than add official nginx deb repos:



      deb http://nginx.org/packages/debian/ codename nginx
      deb-src http://nginx.org/packages/debian/ codename nginx

      wget http://nginx.org/keys/nginx_signing.key
      sudo apt-key add nginx_signing.key


      Finally install nginx:



      apt-get update
      apt-get install nginx


      https://nginx.org/en/linux_packages.html



      It should work now. If not - see /var/log/nginx/error.log and fix errors.






      share|improve this answer



























        0












        0








        0







        Remove all nginx packets with:



        aptitude purge nginx nginx-full


        Than add official nginx deb repos:



        deb http://nginx.org/packages/debian/ codename nginx
        deb-src http://nginx.org/packages/debian/ codename nginx

        wget http://nginx.org/keys/nginx_signing.key
        sudo apt-key add nginx_signing.key


        Finally install nginx:



        apt-get update
        apt-get install nginx


        https://nginx.org/en/linux_packages.html



        It should work now. If not - see /var/log/nginx/error.log and fix errors.






        share|improve this answer















        Remove all nginx packets with:



        aptitude purge nginx nginx-full


        Than add official nginx deb repos:



        deb http://nginx.org/packages/debian/ codename nginx
        deb-src http://nginx.org/packages/debian/ codename nginx

        wget http://nginx.org/keys/nginx_signing.key
        sudo apt-key add nginx_signing.key


        Finally install nginx:



        apt-get update
        apt-get install nginx


        https://nginx.org/en/linux_packages.html



        It should work now. If not - see /var/log/nginx/error.log and fix errors.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 30 '16 at 3:53









        techraf

        3,35381735




        3,35381735










        answered Jun 11 '15 at 8:47









        Oleg AbrazhaevOleg Abrazhaev

        15319




        15319



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • 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%2fserverfault.com%2fquestions%2f691428%2fnginx-upgrade-to-1-8-now-getting-502-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

            RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos