server {
charset utf8;
source_charset utf8;
server_name site.ru www.site.ru;
listen 0.0.0.0:80;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8181/;
proxy_redirect off;
}
}
server {
root /home/user/path/www;
index index.html index.php;
error_log /home/user/path/error.log;
charset utf8;
source_charset utf8;
server_name site.ru www.site.ru;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html /index.php;
}
#error_page 404 /404.html;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/user/path/www$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
exec($dir . '/scenario.sh > /dev/null 2>&1 &');
exec('php script.php > /dev/null 2>&1 &');
function image_callback(response)
{
if (response.is_image)
{
var thumb_name = response.file;
var full_name = thumb_name.replace('_thumb','');
$(response.target_field).val(response.file);
var image = $(response.target_image);
if (image.length)
{
image.attr('src',response.file);
}
else
{
var image_id = response.target_image.replace('#','');
$(response.target_field).before('<img src="' + response.file + '" id="' + image_id + '"/>');
}
}
}