<div dir="ltr">Hello,<div>Where did you PHP install?</div><div>You can edit /path/to/php_dir/etc/php-fpm.conf,or sometimes there will be a dir called 'www.conf.d',if it is,please change in the directory,and edit www.conf which is in the www.conf.d.</div><div>You will find a option called 'listen' in the configuration file below,make sure the option's content is '<a href="http://127.0.0.1:8080">127.0.0.1:8080</a>',if not,you can edit it as '127.0.0.1:8080'.You can also edit the nginx configuration file,change the option 'fastcgi_pass'.</div><div>But I recommend use socket to connect php-fastcgi,it is faster.To do this,just change the php-fpm.conf or www.conf likes follow:</div><div><div class="" id="crayon-57776551ed5aa816210556-2" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">[</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">www</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">]</span></div><div class="" id="crayon-57776551ed5aa816210556-3" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;background:0px center rgb(253,253,253);height:inherit;color:rgb(0,0,0);white-space:pre;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">.</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">.</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">.</span></div><div class="" id="crayon-57776551ed5aa816210556-4" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">user</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">=</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">www</span></div><div class="" id="crayon-57776551ed5aa816210556-5" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;background:0px center rgb(253,253,253);height:inherit;color:rgb(0,0,0);white-space:pre;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">group</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">=</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important">www</span></div><div class="" id="crayon-57776551ed5aa816210556-6" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">.</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">.</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(51,51,51)!important">.</span></div><div class="" id="crayon-57776551ed5aa816210556-7" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;background:0px center rgb(253,253,253);height:inherit;color:rgb(0,0,0);white-space:pre;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">listen</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">=</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">/</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">dev</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">/</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">shm</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">/</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">php</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">-</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">cgi</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">.sock</span></div><div class="" id="crayon-57776551ed5aa816210556-8" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">listen</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">.owner</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">=</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">www</span></div><div class="" id="crayon-57776551ed5aa816210556-9" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;background:0px center rgb(253,253,253);height:inherit;color:rgb(0,0,0);white-space:pre;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">listen</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">.group</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">=</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">www</span></div><div class="" id="crayon-57776551ed5aa816210556-10" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,45,122)!important">listen</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,78,208)!important">.mode</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important">=</span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(0,111,224)!important"> </span><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(206,0,0)!important">0660</span></div></div><div class="" id="crayon-57776551ed5aa816210556-10" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(206,0,0)!important"><br></span></div><div class="" id="crayon-57776551ed5aa816210556-10" style="border:0px;font-family:Monaco,MonacoRegular,"Courier New",monospace;font-size:12px;margin:0px;outline:0px;padding:0px 5px;vertical-align:baseline;height:inherit;color:rgb(0,0,0);white-space:pre;background:rgb(247,247,247)!important;line-height:inherit!important"><span class="" style="border:0px;font-family:inherit;font-style:inherit;margin:0px;outline:0px;padding:0px;vertical-align:baseline;height:inherit;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;color:rgb(206,0,0)!important"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">'...'just stands for something omitted.</div><div class="gmail_quote">And then change the 'fastcgi_pass' option to 'unix:/dev/shm/php-cgi.sock',restart nginx and PHP,all done!</div><div class="gmail_quote"><br></div><div class="gmail_quote">P.S:My mother tongue isn't English,if there is something you couldn't understand,please let my konw,thanks!</div><div class="gmail_quote">2016-07-02 14:21 GMT+08:00 yair avendaño <span dir="ltr"><<a href="mailto:gnu.yair@outlook.com" target="_blank">gnu.yair@outlook.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif">
<p><span lang="en"><span>Hi</span> <span>I'm</span>
<span>setting up a</span> <span>nginx</span> <span>as a reverse</span> <span>
proxy</span> <span>but</span> <span>to</span> <span>try to see</span>
<span>a site with</span> <span>drupal</span> <span>locally</span> <span>that</span>
<span>have</span> <span>shown</span> <span>me</span> <span>502</span> <span>Bad</span>
<span>Gateway</span> <span>error</span><span>.</span><br>
<span>this gets</span> <span>me</span> <span>in the logs.</span></span></p>
<p><span lang="en"><span><br>
</span></span></p>
<p><span lang="en"><span></span></span><span lang="en"><span><span>016/07/02 00:51:57 [error] 18120#0: *61 upstream sent unsupported FastCGI protocol version: 72 while reading response header
 from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://<a href="http://127.0.0.1:8080" target="_blank">127.0.0.1:8080</a>", host: " localhost"</span></span></span></p>
<p><span lang="en"><span><span><br>
</span></span></span></p>
<p><span lang="en"><span><span><br>
</span></span></span></p>
<p><span lang="en"><span><span><span lang="en"><span>I can not</span>
<span>get him out of</span> <span>there</span> <span>I find</span> <span>that causes</span>
<span>this</span> <span>error.</span> <span>the</span> <span>server operating system</span>
<span>is a</span> <span>gentoo</span><span>.</span> <span>I show my</span>
<span>vhost</span></span></span></span></span></p>
<p><span lang="en"><span><span><span lang="en"><span><br>
</span></span></span></span></span></p>
<p><span lang="en"><span><span><span lang="en"><span><span></span></span></span></span></span></span></p>
<div>server {<br>
               listen 80;<br>
               server_name localhost;<br>
<br>
               access_log /var/log/nginx/localhost_access_log main;<br>
               error_log /var/log/nginx/localhost_error_log info;<br>
<br>
               root /var/www/site/prueva/www/;<br>
<br>
                location / {<br>
                index index.html index.htm index.php;<br>
                autoindex on;<br>
                autoindex_exact_size off;<br>
                autoindex_localtime on;<br>
<br>
                                }<br>
<br>
                         location ~ \.php$ {<br>
                       # Test for non-existent scripts or throw a 404 error<br>
                       # Without this line, nginx will blindly send any request ending in .php to php-fpm<br>
                       try_files $uri =404;<br>
                        include /etc/nginx/fastcgi.conf;<br>
                       fastcgi_pass <a href="http://127.0.0.1:8080" target="_blank">127.0.0.1:8080</a>;  ## Make sure the socket corresponds with PHP-FPM conf file<br>
                        }<br>
                }<br>
</div>
<span></span><br>
<p></p>
</div>
</div>

<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div></div>