Короче поставил связку апачи+никс. Сейчас выдает при заходе на домен страницу никс. Пытаюсь настроить конфиги для каждого сайта, перебрал тучу вариантов но итог везде один - [root@sever ~]# /etc/init.d/nginx restart
nginx: [emerg] unknown directive "server" in /etc/nginx/conf.d/site.com.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx.conf
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
include /usr/local/ispmgr/etc/nginx.domain;
client_max_body_size 16M;
}
Один из вариантов site.com.conf
server {
listen ip_servera:80;
server_name www.my-site.ru my-site.ru;
access_log /var/www/user/data/my-site.ru/logs/my-site.ru.access.log;
error_log /var/www/user/data/my-site.ru/logs/my-site.ru.error.log;
location /
{
proxy_pass http://127.0.0.1/;
proxy_read_timeout 600;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_buffering off;
}
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)$ {
root /home/test.ru/html;
expires 2d;
}
}