Nginx 1.4.6 throwing 503 errors

May 7, 2016 448 views
LEMP WordPress Ubuntu

I have configured 2 website (wordpress and laravel v4) on digitalocean droplet - nginx/1.4.6 (Ubuntu).

Both of the websites normal work very good, quick.

But at the time of any data save in laravel website, it throughs 503 error.
and in wordpress it does not thorough 503 error, but takes too long time to response near about 1-3min at the time of saving any post or any data.

Both sites virtual host configuration is same as below.

server {
        listen 80;

        listen 443 ssl;

        root /var/www/;

        index index.php index.html index.htm;

        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;

        # Make site accessible from http://localhost/

        access_log off;

        #GZIP Configuration
        gzip on;
        gzip_min_length 100;
        gzip_comp_level 3;

        gzip_types text/plain;
        gzip_types text/css;
        gzip_types text/javascript;

        gzip_disable "msie6";

        location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
                if ($host !~* ^www\.)
                        rewrite  ^/(.*)$  http://www.$host/$1  permanent;
                proxy_read_timeout 300;

        error_page 404 /error.html;

        location ^~ /error.html {
                rewrite ^/.* permanent;

        location ~* \.(css|js|jpg|png|gif)$ {
                access_log off;
                expires 1M;
                add_header Pragma public;
                add_header Cache-Control public;
                add_header Vary Accept-Encoding;

        try_files $uri $uri/ @rewrite;

        location @rewrite {
               rewrite ^/(.*)$ /index.php?_url=/$1;

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_read_timeout 600s;
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;

                fastcgi_param PATH_INFO    $fastcgi_path_info;

                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;


I have also checked error logs also, there nothing any critical issue found.

Please guide me why Laravel v4 website showing me 503 error, and why wordpress site is slow at the time of saving data.

1 Answer

Hi @hkp,

I believe you've also asked this question on StackOverflow ( Did this solve your issue? and do you still need assistance?

Have another answer? Share your knowledge.