В моем случае работает вот с такой конфигурацией
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://127.0.0.1:8080;
}
location ~ \.php$ {
if (!-e $document_root$document_uri) {
return 404;
}
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^.+\.(txt|jpg|jpeg|gif|mpg|mpeg|avi|png|css|swf|ico|zip|rar|sdt|js|bmp|wav|mp3|mmf|mid|vkp|sisx|sis|exe|jar|thm|nth|doc)$ {
access_log off;
expires 1w;
add_header Cache-Control 'public';
try_files $uri @notfound;
}
location @notfound {
proxy_pass http://127.0.0.1:8080$request_uri;
}