server {
        listen       81;
        server_name  www.weiling.co;
        rewrite ^ http://weiling.co$request_uri? permanent;
        }

server {
        listen       81;
        server_name 'weiling.co';

        location ~ ^/images/ {
                root /www/weiling-company/current/public;
                gzip_static on;
                expires max;
                add_header Cache-Control public;
                break;
         }

        location ~ ^/assets/ {
                root /www/weiling-company/current/public;
                gzip_static on;
                expires max;
                add_header Cache-Control public;
                break;
        }

        location ~ ^/static/ {
                root /www/weiling-company/current/public;
                gzip_static on;
                expires max;
                add_header Cache-Control public;
                break;
        }

        location ~ ^/system/uploads/ {
                root /www/weiling-company/current/public;
                gzip_static on;
                expires max;
                add_header Cache-Control public;
                break;
        }


        location / {
                root   /www/weiling-company/current/public;
                index  index.html index.htm;
                proxy_pass         http://127.0.0.1:4000/;
                proxy_redirect     off;

                proxy_set_header   Host             $host;
                proxy_set_header   X-Real-IP        $remote_addr;
                proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_connect_timeout      90;
                proxy_send_timeout         90;
                proxy_read_timeout         90;

                proxy_buffer_size          4k;
                proxy_buffers              4 32k;
                proxy_busy_buffers_size    64k;
                proxy_temp_file_write_size 64k;

                proxy_temp_path            /tmp/nginx-proxy_temp;

        }



        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
                root   html;
        }

}



