Я не понял что у вас там не получилось... честно...
У меня на сервере
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.3 (squeeze)
Release: 6.0.3
Codename: squeeze
версии по
# dpkg -l |grep -E "apache|ngin"x
ii apache2 2.2.16-6+squeeze4 Apache HTTP Server metapackage
ii apache2-mpm-worker 2.2.16-6+squeeze4 Apache HTTP Server - high speed threaded model
ii apache2-utils 2.2.16-6+squeeze4 utility programs for webservers
ii apache2.2-bin 2.2.16-6+squeeze4 Apache HTTP Server common binary files
ii apache2.2-common 2.2.16-6+squeeze4 Apache HTTP Server common files
ii nginx 0.7.67-3 small, but very powerful and efficient web server and mail proxy
конфиги
nginx
# cat /etc/nginx/sites-enabled/default
server {
listen 80;
server_name mysite.ru www.mysite.ru;
access_log /var/log/nginx.access_log;
location ~* ^.+\.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ {
root /var/www;
index index.html index.php;
access_log off;
expires 30d;
}
location ~ /\.ht {
deny all;
}
location / {
proxy_pass http://127.0.0.1:81/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header Host $host;
proxy_connect_timeout 60;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_redirect off;
proxy_set_header Connection close;
proxy_pass_header Content-Type;
proxy_pass_header Content-Disposition;
proxy_pass_header Content-Length;
}
}apache2
# cat /etc/apache2/sites-enabled/000-default
<VirtualHost *:81>
ServerAdmin webmaster@localhost
DocumentRoot /var/lib/asterisk/static-http
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/lib/asterisk/static-http/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
root@gw:/etc/nginx/sites-available# cat /etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:81
Listen 81
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
netstat -nap -A inet
root@gw:/etc/nginx/sites-available# netstat -nap -A inet6|grep apache2
tcp6 0 0 :::81 :::* LISTEN 6320/apache2
root@gw:/etc/nginx/sites-available# netstat -nap -A inet|grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6411/nginx
ip a
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:1a:4d:38:5d:21 brd ff:ff:ff:ff:ff:ff
inet 192.168.254.1/24 brd 192.168.254.255 scope global eth1
inet6 fe80::21a:4dff:fe38:5d21/64 scope link
valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:80:48:37:d0:f4 brd ff:ff:ff:ff:ff:ff
inet 10.110.1.103/27 brd 10.110.1.127 scope global eth0
inet6 fe80::280:48ff:fe37:d0f4/64 scope link
valid_lft forever preferred_lft forever
скрины
1 и 2 - это я к nginx обращаюсь, то есть тупо ip вбиваю в строке браузера, 3 и 4 это я руками вбиваю еще и порт
ps
может я чего не так понял.... но у меня все нормально работает... nginx проксирует к апачу