location /node/ {
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 Host $host;
proxy_http_version 1.1;
proxy_pass http://socket_nodes;
}
upstream socket_nodes {
ip_hash;
server 127.0.0.1:8095;
}
.fixed{
position: fixed;
top: 0;//отступ сверху
right: 0; //прижали вправо
}
var needOffset = 500;
$(window).scroll(function(event){
if($(window).scrollTop() >= needOffset){
$('.block_fixed').addClass('fixed');
}else{
$('.block_fixed').removeClass('fixed');
}
});
$(function() {
$('.form-order').on('submit', function() {
var empty = $(':text', this).filter(function() {
return $.trim($(this).val()).length < 3;
}).length;
if (empty) {
alert('В полях должно быть более 3 символов')
return false;
}
$.ajax({
type: 'POST',
url: '../php/send.php',
data: $(this).serialize(),
success: function(data) {
if (data) {
$('.result').text('Ваша заявка отправлена');
}
},
error: function(xhr, str) {
alert('Возникла ошибка: ' + xhr.responseCode);
}
});
});
});