Nevermind. I got it. Solution is like as shown below.
server {
listen 443 ssl;
server_name sdnx.biz;
root /var/www/html/;
location ^~ /static {
alias /var/www/html/static;
}
This will exclude the static files from proxy pass and rest can be forwarded to upstream servers as shown below
location / {
proxy_pass
http://nxha-upstreamservers;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
}
}