Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

,



nginx, .
nginx :

server {
listen xxx.xxx.xx.xxx;
server_name domain.ru *.domain.ru;
access_log /var/log/nginx/domain-access;
error_log /var/log/nginx/domain-error error;

root /var/www/domain/$subdomain;
set $subdomain "";
if ($host ~* ^([a-z0-9-\.]+)\.domain.ru$) {
set $subdomain $1;
}
if ($host ~* ^www.domain.ru$) {
set $subdomain "";
}

location / {
proxy_pass http://127.0.0.1:8000/;
index index.html index.php;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}

:

<VirtualHost 127.0.0.1:8000>
ServerName domain.ru
ServerAlias *.domain.ru
DocumentRoot /var/www/domain
ErrorLog "/var/log/apache2/domain-error.log"
CustomLog "/var/log/apache2/domain-access.log" combined

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.domain.ru$
RewriteCond %{HTTP_HOST} ^((.*).)domain.ru$ [NC]
RewriteRule ^/(.*) /%2/$1 [L,QSA]
<Directory "/var/www/domain">
Options FollowSymLinks -MultiViews -Indexes
AllowOverride All
Order allow,deny
Allow from all
</directory>

RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
RPAFheader X-Real-IP

</VirtualHost>

, subdomain.domain.ru - domain.ru, subdomain.domain.ru/index.php - . - ..

--
Best regards,
Anton Kiryushkin,



 




Copyright © Lexa Software, 1996-2009.