Question

Nginx with wordpress refused varnish static content requests, gives 503 errors

  • Posted April 16, 2014

Hi!

I just added another wordpress site to my ubuntu server. 2 wordpress sites, not multisite.

They use 2 different fpm pool with same config. Their Nginx config files are basically identical except the fpm socket name and listen to different ip ports.

Site A works perfectly as usual. Site B ( the newly install one ) gives 503 error for all the static files, e.g.: js, css, png, etc

Php and Nginx error logs show no error for this issue.

Conformed that varnish and nginx is connected to each others( at least for php ). In fact, Site B could show the wordpress hello world blog post.

While stopping varnish and use nginx alone. Site B works perfectly with all static content loaded !! However, static files still give 503 errors after turnning varnish back on.

More info: $curl 127.0.0.1:80/robots.txt

return correct files from site A

$curl 127.0.0.2:80/robots.txt

return 503

$ sudo netstat -anp | grep varnish [sudo] password for tangrufus: tcp 0 0 127.0.0.1:6082 0.0.0.0:* LISTEN 1765/varnishd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1766/varnishd tcp 0 0 127.0.0.1:46727 127.0.0.2:8080 ESTABLISHED 1766/varnishd tcp 0 0 127.0.0.1:33175 127.0.0.1:8080 ESTABLISHED 1766/varnishd tcp6 0 0 :::80 :::* LISTEN 1766/varnishd unix 2 [ ] DGRAM 11594 1765/varnishd $ sudo netstat -anp | grep nginx tcp 0 0 127.0.0.2:8080 0.0.0.0:* LISTEN 1960/nginx tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1960/nginx tcp 0 0 127.0.0.1:8080 127.0.0.1:33240 ESTABLISHED 1963/nginx: worker unix 3 [ ] STREAM CONNECTED 12812 1960/nginx unix 3 [ ] STREAM CONNECTED 12811 1960/nginx Please help

Subscribe
Share

Submit an 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.

What are the contents of your Varnish configuration: /etc/varnish/default.vcl

Confirmed that varnish did make a request to correct nginx backend.