Report this

What is the reason for this report?

Nginx 1.4.6 throwing 503 errors

Posted on May 7, 2016
hkp

By hkp

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/domain1.com/public_html;

        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/
        server_name domain1.com www.domain1.com;


        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 ^/.* http://www.domain1.com 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_pass 127.0.0.1:9000;
                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.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @hkp,

I believe you’ve also asked this question on StackOverflow (http://stackoverflow.com/questions/37086663/nginx-1-4-6-throwing-503-errors). Did this solve your issue? and do you still need assistance?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.