локейшены не перекрываются.
Но на всякий, вот полный конфиг:
server {
listen 12.12.12.12:80;
server_name site.ru www.site.ru;
location ^~ /stat/ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index st.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
include fastcgi_params;
}
location / {
proxy_pass http://24.24.24.24:80;
proxy_redirect http://24.24.24.24:80/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|ico)$ {
proxy_pass http://24.24.24.24:80;
}
}