nginx настроен на 80,apache на 81.
Все выключаем и телнетимся - естественно отлуп.
Включаем nginx и телнетимся на 80,81 - отлуп.
Выключаем nginx и включаем апач, телнетемся на 80 - ок, на 81 - ок. Так не бывает

кинфиг nginx и виртуала в одном
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
...
server {
listen 80;
server_name domain.com;
access_log /var/log/nginx/localhost.access.log;
error_log /var/log/nginx/localhost.error.log;
location / {
proxy_pass http://ip:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* ^.+\.(jpeg|jpg|gif|png)$ {
root /var/www/domain;
}
}
[email protected]:~# netstat -4nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3320/mysqld
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 16001/nginx
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 25899/vsftpd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 13350/exim4
[email protected]:~# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere indarium.vdsplanet.net tcp dpt:www to:ip:81
DNAT tcp -- anywhere indarium.vdsplanet.net tcp dpt:www to:ip:81
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
апач
listen 81;
...
<VirtualHost domain.com:*>
ServerAdmin
[email protected] ServerName domain.com
ServerAdmin
[email protected] DocumentRoot /var/www/domain
ErrorLog /var/log/apache2/error_g.log
LogLevel warn
CustomLog /var/log/apache2/access_g.log common
</VirtualHost>
debian 5.