Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th February 2013, 19:13
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 182
Thanks: 57
Thanked 9 Times in 9 Posts
Exclamation NGINX 504 Gateway Time-out

After last Nginx update couple of days ago, I'm getting the following 504 Gateway Time-out nginx/1.2.7 when I use any of the web forms (oSticket & WordPress)

Log
2013/02/20 23:38:13 [error] 14032#0: *15756 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.1.122,
server: mydomain.com, request: "POST /contact/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9024", host: "mydomain.com", referrer: "http://mydomain.com/contact/"


Did anything change within nginx, anyone else has this issue, any idea how to fix. Thanks!

Here's my existing nginx directive:
Code:
location / {
                try_files $uri $uri/ /index.php?$args;
           }
      # Add trailing slash to */wp-admin requests.
       rewrite /wp-admin$ $scheme://$host$uri/ permanent;

       location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
            }
location ~* \.php$ {
    fastcgi_pass 127.0.0.1:9001;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_temp_file_write_size 10m;
    fastcgi_busy_buffers_size 512k;
    fastcgi_buffer_size 512k;
    fastcgi_buffers 16 512k;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_intercept_errors on;
    fastcgi_next_upstream error invalid_header timeout http_500;
}
__________________
ISPConfig 3.0.5.3 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14

Last edited by onastvar; 21st February 2013 at 07:12.
Reply With Quote
Sponsored Links
  #2  
Old 22nd February 2013, 13:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Did you check if a PHP-FPM pool is running on port 9024? Maybe you need to (re)start PHP-FPM.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 23rd February 2013, 07:24
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 182
Thanks: 57
Thanked 9 Times in 9 Posts
Default

Hi Falko, Thanks for your reply. PHP-FPM pool is running on port 9024, I restarted it. Same problem, anything else I should check?
__________________
ISPConfig 3.0.5.3 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
The Following User Says Thank You to onastvar For This Useful Post:
Huntkqa (28th February 2013)
  #4  
Old 25th February 2013, 18:47
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

What's the output of
Code:
netstat -tap
?

Did you check the PHP-FPM log?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 26th February 2013, 21:13
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 182
Thanks: 57
Thanked 9 Times in 9 Posts
Default

This is netstat -tap

Code:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State                                                                                     PID/Program name
tcp        0      0 *:pop3                  *:*                     LISTEN                                                                                    2580/dovecot
tcp        0      0 *:imap2                 *:*                     LISTEN                                                                                    2580/dovecot
tcp        0      0 *:sunrpc                *:*                     LISTEN                                                                                    983/portmap
tcp        0      0 *:www                   *:*                     LISTEN                                                                                    8091/nginx
tcp        0      0 *:http-alt              *:*                     LISTEN                                                                                    8091/nginx
tcp        0      0 *:tproxy                *:*                     LISTEN                                                                                    8091/nginx
tcp        0      0 localhost.localdom:9010 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9011 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9012 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 *:ftp                   *:*                     LISTEN                                                                                    2699/pure-ftpd (SER
tcp        0      0 sun.mydomain.com:domain *:*                     LISTEN                                                                                    1841/named
tcp        0      0 localhost.locald:domain *:*                     LISTEN                                                                                    1841/named
tcp        0      0 localhost.localdom:9013 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 *:44565                 *:*                     LISTEN                                                                                    995/rpc.statd
tcp        0      0 *:ssh                   *:*                     LISTEN                                                                                    1861/sshd
tcp        0      0 localhost.localdom:9014 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9015 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 *:smtp                  *:*                     LISTEN                                                                                    2684/master
tcp        0      0 localhost.localdoma:953 *:*                     LISTEN                                                                                    1841/named
tcp        0      0 localhost.localdom:9017 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9018 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9020 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9021 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9023 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 localhost.localdom:9024 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 *:imaps                 *:*                     LISTEN                                                                                    2580/dovecot
tcp        0      0 *:pop3s                 *:*                     LISTEN                                                                                    2580/dovecot
tcp        0      0 localhost.localdo:10024 *:*                     LISTEN                                                                                    1840/amavisd (maste
tcp        0      0 localhost.localdo:10025 *:*                     LISTEN                                                                                    2684/master
tcp        0      0 localhost.localdom:9033 *:*                     LISTEN                                                                                    7821/php-fpm.conf)
tcp        0      0 *:mysql                 *:*                     LISTEN                                                                                    2227/mysqld
tcp        0      0 localhost.localdo:imap2 localhost.localdo:51776 TIME_WAIT                                                                                 -
tcp        0      0 localhost.localdo:47544 localhost.localdo:mysql ESTABLISHED                                                                               2399/amavisd (ch14-
tcp        9      0 localhost.localdom:9010 localhost.localdo:57650 CLOSE_WAIT                                                                                7994/php-fpm: pool
tcp        0      0 localhost.localdo:imap2 localhost.localdo:51777 TIME_WAIT                                                                                 -
tcp        0      0 localhost.localdo:mysql localhost.localdo:47716 ESTABLISHED                                                                               2227/mysqld
tcp        0      0 localhost.localdo:imap2 localhost.localdo:51774 TIME_WAIT                                                                                 -
tcp        0      0 sun.mydomain.:tproxy 192.168.1.122:52726     TIME_WAIT                                                                                 -
tcp        0      0 localhost.localdom:9024 localhost.localdo:50016 TIME_WAIT                                                                                 -
tcp        0      0 localhost.localdo:mysql localhost.localdo:47544 ESTABLISHED                                                                               2227/mysqld
tcp        0      0 localhost.localdo:imap2 localhost.localdo:51778 TIME_WAIT                                                                                 -
tcp        0      0 localhost.localdo:47716 localhost.localdo:mysql ESTABLISHED                                                                               2400/amavisd (ch13-
tcp        0      0 sun.mydomain.com:www 192.168.1.122:52725     TIME_WAIT                                                                                 -
tcp        0      0 sun.mydomain.com:ssh 192.168.1.122:57078     ESTABLISHED                                                                               5765/sshd: webmaste
tcp6       0      0 [::]:pop3               [::]:*                  LISTEN                                                                                    2580/dovecot
tcp6       0      0 [::]:imap2              [::]:*                  LISTEN                                                                                    2580/dovecot
tcp6       0      0 [::]:ftp                [::]:*                  LISTEN                                                                                    2699/pure-ftpd (SER
tcp6       0      0 [::]:domain             [::]:*                  LISTEN                                                                                    1841/named
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN                                                                                    1861/sshd
tcp6       0      0 [::]:smtp               [::]:*                  LISTEN                                                                                    2684/master
tcp6       0      0 ip6-localhost:953       [::]:*                  LISTEN                                                                                    1841/named
tcp6       0      0 [::]:imaps              [::]:*                  LISTEN                                                                                    2580/dovecot
tcp6       0      0 [::]:pop3s              [::]:*                  LISTEN
This is my php5-fpm.log

Code:
[26-Feb-2013 00:43:03] NOTICE: fpm is running, pid 7327
[26-Feb-2013 00:43:03] NOTICE: ready to handle connections
[26-Feb-2013 00:51:02] NOTICE: Reloading in progress ...
[26-Feb-2013 00:51:02] NOTICE: reloading: execvp("/usr/sbin/php5-fpm", {"/usr/sbin/php5-fpm", "--fpm-config", "/etc/php5/fpm/php-fpm.conf"})
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=7, "/var/lib/php5-fpm/ispconfig.sock"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=7, "/var/lib/php5-fpm/ispconfig.sock"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=9, "127.0.0.1:9013"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=9, "127.0.0.1:9013"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=10, "127.0.0.1:9017"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=10, "127.0.0.1:9017"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=11, "127.0.0.1:9018"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=11, "127.0.0.1:9018"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=12, "127.0.0.1:9020"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=12, "127.0.0.1:9020"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=13, "127.0.0.1:9011"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=13, "127.0.0.1:9011"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=27, "/tmp/php5-fpm.sock"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=27, "/tmp/php5-fpm.sock"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=15, "127.0.0.1:9023"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=15, "127.0.0.1:9023"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=16, "127.0.0.1:9021"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=16, "127.0.0.1:9021"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=17, "127.0.0.1:9033"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=17, "127.0.0.1:9033"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=18, "127.0.0.1:9010"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=18, "127.0.0.1:9010"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=19, "127.0.0.1:9012"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=19, "127.0.0.1:9012"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=20, "/var/lib/php5-fpm/apps.sock"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=20, "/var/lib/php5-fpm/apps.sock"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=22, "127.0.0.1:9015"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=22, "127.0.0.1:9015"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=23, "127.0.0.1:9014"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=23, "127.0.0.1:9014"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=24, "127.0.0.1:9024"
[26-Feb-2013 00:51:02] NOTICE: using inherited socket fd=24, "127.0.0.1:9024"
[26-Feb-2013 00:51:02] NOTICE: fpm is running, pid 7821
[26-Feb-2013 00:51:03] NOTICE: ready to handle connections
__________________
ISPConfig 3.0.5.3 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14

Last edited by onastvar; 26th February 2013 at 21:16.
Reply With Quote
  #6  
Old 27th February 2013, 15:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Looks ok. Is this a physical server or a virtual machine?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 27th February 2013, 15:17
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 182
Thanks: 57
Thanked 9 Times in 9 Posts
Default

This is a physical server.
__________________
ISPConfig 3.0.5.3 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
  #8  
Old 28th February 2013, 13:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Hm... Have you tried to restart PHP-FPM?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 28th February 2013, 15:44
onastvar onastvar is offline
Senior Member
 
Join Date: Apr 2008
Location: U.S.A.
Posts: 182
Thanks: 57
Thanked 9 Times in 9 Posts
Default

Yes, restarted PHP-FPM multiple times, still same issue.
__________________
ISPConfig 3.0.5.3 | Debian Wheezy | BIND | Dovecot 1.2.15 | Apache 2.2.16 | MySQL 5.5 | PHP 5.4.4-14
Reply With Quote
  #10  
Old 1st March 2013, 04:19
webelo webelo is offline
Junior Member
 
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

I just started experience this on a few VM servers.
A quick fix that worked was doing a server reboot, but can't be rebooting all the time so gotta find a solution soon.

My setup is varnish -> nginx -> php-fpm

I'll be looking into it now if I find anything I'll post here.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hacked server Captain Installation/Configuration 8 23rd December 2010 10:39
CPU load locks up box. Apache or MYSQL related. crypted General 61 29th October 2010 22:16
rkhunter report Captain Installation/Configuration 6 10th October 2010 13:05
adding mail boxes kwickcut Server Operation 20 11th August 2010 01:02
504 Bad gateway, Fedoracore 5 ISPconfig main3 Installation/Configuration 12 20th August 2006 11:38


All times are GMT +2. The time now is 21:26.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.