Код: Выделить всё
worker_processes 4;
user www www;
#keepalive_timeout 0;
#gzip_static off
#gzip_vary off
#error_log /usr/log/nginx/nginx.error_log debug;
events {
worker_connections 1024;
# use kqueue;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "http_x_forwarded_for"';
access_log off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# directio 20m;
# expires max;
#set $limit_rate 196K;
# limit_rate_after 1m;
client_header_timeout 30m;
client_body_timeout 30m;
client_max_body_size 1000m;
# send_timeout 3m;
# client_header_buffer_size 1k;
# large_client_header_buffers 4 4k;
# gzip on;
# gzip_min_length 1100;
# gzip_buffers 4 8k;
# gzip_types text/plain;
# send_lowat 12000;
# keepalive_timeout 75 20;
server {
listen 80;
server_name XXX.ru www.XXX.ru;
keepalive_timeout 70;
# Main location
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 1000m;
client_body_buffer_size 500m;
proxy_connect_timeout 200;
proxy_send_timeout 60;
proxy_read_timeout 200;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location ~* \.(jpg|jpeg|gif|png)$ {
root /usr/local/www/apache22/data;
access_log off;
expires 30d;
}
}
server {
listen 80;
server_name forum.XXX.ru;
keepalive_timeout 70;
# Main location
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 20m;
client_body_buffer_size 128k;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location ~* \.(jpg|jpeg|gif|png)$ {
root /usr/local/www/apache22/data/_forum;
access_log off;
expires 30d;
}
}
}
Код: Выделить всё
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "/usr/local/www/apache22/data/"
ServerName www.XXX.ru
ServerAlias XXX.ru
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "/usr/local/www/apache22/data/_forum/"
ServerName forum.XXX.ru
</VirtualHost>
Если набирает в браузере сайт:80 или сайт:8080 - ссылается в одно место. Нгикс работает... А вот почему не ходит по вирт хостам хз, что может быть? Натолкните пожалуйста