Linode Forum
https://forum.linode.com/

Gateway Timeout Error Sending Emails
https://forum.linode.com/viewtopic.php?f=11&t=5427
Page 1 of 1

Author:  illusime [ Fri Apr 09, 2010 11:48 pm ]
Post subject:  Gateway Timeout Error Sending Emails

After installing Nginx and stopping apache services, I always get the following error when sending out emails using my wordpress plugin. I'm using postfix for email server. How can I fix it??

504 Gateway = Time-out nginx/0.5.33

Author:  obs [ Sat Apr 10, 2010 6:48 am ]
Post subject: 

Gateway timeout means that the PHP back end doesn't respond to the nginx server, what are you using to power PHP?

Also..nginx0.5.33...that's so old. Upgrade to the 0.7 branch at least.

Author:  illusime [ Mon Apr 12, 2010 1:10 am ]
Post subject: 

I have just upgraded to the latest nginx. However I'm still getting the same error. I'm using php fastcgi. How can I make it work?

Author:  obs [ Mon Apr 12, 2010 1:17 am ]
Post subject: 

Can you post your nginx configuration?

Author:  illusime [ Mon Apr 12, 2010 1:59 am ]
Post subject: 

I found this in the error.log. It might help:

Code:
www.vectordiary.com, request: "GET /feed/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.vectordiary.com"
2010/04/12 05:07:46 [error] 32732#0: *389 FastCGI sent in stderr: "ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker '125.166.47.106', file '/home/tony/public_html/vectordiary.com/public/wp-content/plugins/wishlist-member/core/PluginMethods.php(111) : eval()'d code(3) : eval()'d code', line 94)" while reading response header from upstream, client: 125.166.47.106, server: www.vectordiary.com, request: "POST /wp-admin/admin.php?page=WishListMember&wl=members&mode=broadcast HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.vectordiary.com", referrer: "http://www.vectordiary.com/wp-admin/admin.php?page=WishListMember&wl=members&mode=broadcast"

Author:  illusime [ Mon Apr 12, 2010 2:04 am ]
Post subject: 

Here is my nginx config file:

Code:
user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    include /etc/nginx/sites-enabled/*;

}


Code:
server {
    listen       0.0.0.0:80;
    server_name   www.vectordiary.com vectordiary.com;
    root   /home/tony/public_html/vectordiary.com/public;
    index  index.php;

    charset utf-8;

    location / {
#       gzip_static on;

         # if the requested file exists, return it immediately
        if (-f $request_filename) {
                break;
        }

        set $supercache_file '';
        set $supercache_uri $request_uri;

        if ($request_method = POST) {
                set $supercache_uri '';
        }

        # Using pretty permalinks, so bypass the cache for any query string
        if ($query_string) {
                set $supercache_uri '';
        }

        if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
                set $supercache_uri '';
        }

        # if we haven't bypassed the cache, specify our supercache file
        if ($supercache_uri ~ ^(.+)$) {
                set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
        }

        # only rewrite to the supercache file if it actually exists
        if (-f $document_root$supercache_file) {
                rewrite ^(.*)$ $supercache_file break;
        }

        # feedburner
        if ($http_user_agent !~ FeedBurner) {
          #  rewrite ^/comment/feed/ http://feeds.feedburner.com/your-comment-feed last;
            rewrite ^/feed/ http://feeds.feedburner.com/vectordiary last;
        }

        # all other requests go to Wordpress
        if (!-e $request_filename) {
                rewrite . /index.php last;
        }

      location ~ \.php($|/) {
        set  $script     $uri;
        set  $path_info  "";

        fastcgi_pass   localhost:9000;
        fastcgi_read_timeout 300;
        include /etc/nginx/fastcgi_params;

        fastcgi_param  SCRIPT_FILENAME  /home/tony/public_html/vectordiary.com/public/$fastcgi_script_name;
      }

    }
}

Author:  obs [ Mon Apr 12, 2010 3:43 am ]
Post subject: 

illusime wrote:
I found this in the error.log. It might help:

Code:
www.vectordiary.com, request: "GET /feed/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.vectordiary.com"
2010/04/12 05:07:46 [error] 32732#0: *389 FastCGI sent in stderr: "ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker '125.166.47.106', file '/home/tony/public_html/vectordiary.com/public/wp-content/plugins/wishlist-member/core/PluginMethods.php(111) : eval()'d code(3) : eval()'d code', line 94)" while reading response header from upstream, client: 125.166.47.106, server: www.vectordiary.com, request: "POST /wp-admin/admin.php?page=WishListMember&wl=members&mode=broadcast HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.vectordiary.com", referrer: "http://www.vectordiary.com/wp-admin/admin.php?page=WishListMember&wl=members&mode=broadcast"


That error means your script is trying to increase PHP's memory limit, try increasing the memory limit in your php.ini

Your nginx conf looks fine.

Author:  illusime [ Mon Apr 12, 2010 5:29 am ]
Post subject: 

Thanks. That solved the problem

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/