Welcome! Log In Create A New Profile

Advanced

Проблема подключения хоста

Posted by romartyn 
Проблема подключения хоста
March 18, 2011 09:01PM
Такая тема. Использую nginx вместе с бэкендом apache. Раньше всегда было два сайта и отлично работали.
Решил подключить третий сайт с третьим доменом. Конфиги все скопировал от одного из тех сайтов, заменил в них только различное.
(Все три конфига, что для nginx, что для apache, идентичны, различаются лишь доменом и путём к директории) ... Сто раз всё проверял перепроверял , вешал на разные порты, но всё равно третий сайт не отзывается на nginx, ждёт немного и выдаёт 504 Gateway Time-out.
Но apache на своём 81 порте всё нормально понимает. НАРОД, ВЫРУЧАЙТЕ! Вот конфиги:
nginx.conf =>
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;
server_names_hash_bucket_size 64;
#access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;


gzip on;
gzip_proxied any;
gzip_min_length 1100;
gzip_http_version 1.0;
gzip_buffers 4 8k;
gzip_comp_level 9;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;


include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}



______________________________________________________________________
Содержимое /etc/nginx/sites-enabled/ =>
server
{
listen 80;
server_name www.primeval.ru primeval.ru;
#access_log /var/log/nginx.access_log;
location ~* \.(css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|rtf|swf|ico|flv|txt|docx|xlsx|png|jpg|jpeg|gif)$
{
root /home/romashka/primeval/;
index index.html index.php;
access_log off;
expires 30d;
}
location ~ /\.ht
{
deny all;
}
location /
{
proxy_pass http://www.primeval.ru: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;
}
}
server
{
listen 80;
server_name www.romartyn.ru romartyn.ru;
#access_log /var/log/nginx.access_log;
location ~* \.(css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|rtf|swf|ico|flv|txt|docx|xlsx|png|jpg|jpeg|gif)$
{
root /home/romashka/romartyn/;
index index.html index.php;
access_log off;
expires 30d;
}
location ~ /\.ht
{
deny all;
}
location /
{
proxy_pass http://www.romartyn.ru: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;
}
}
server ####ВОТ С ЭТИМ 3-м И ПРОБЛЕМА
{
listen 80;
server_name www.footblog.ru footblog.ru;
#access_log /var/log/nginx.access_log;
location ~* \.(css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|rtf|swf|ico|flv|txt|docx|xlsx|png|jpg|jpeg|gif)$
{
root /home/romashka/footblog/;
index index.html index.php;
access_log off;
expires 30d;
}
location ~ /\.ht
{
deny all;
}
location /
{
proxy_pass http://www.footblog.ru: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.conf => БЕЗ ЗАКОМЕНЧЕННЫХ СТРОК
ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 1
MaxSpareServers 1
MaxClients 10
MaxRequestsPerChild 0
</IfModule>

<IfModule mpm_worker_module>
StartServers 1
MinSpareThreads 1
MaxSpareThreads 1
ThreadLimit 4
ThreadsPerChild 5
MaxClients 10
MaxRequestsPerChild 0
</IfModule>

<IfModule mpm_event_module>
StartServers 2
MaxClients 20
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

AccessFileName .htaccess

<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>

DefaultType text/plain
HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel warn
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/httpd.conf
Include /etc/apache2/ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

Include /etc/apache2/conf.d/
Include /etc/apache2/sites-enabled/




_________________________________________
ports.conf =>
NameVirtualHost *:81
Listen 81

<IfModule mod_ssl.c>
Listen 443
</IfModule>

<IfModule mod_gnutls.c>
Listen 443
</IfModule>




__________________________________
содержимое /etc/apache2/sites-enabled/ =>
<VirtualHost *:81>
ServerAdmin webmaster@localhost
ServerName primeval.ru
ServerAlias www.primeval.ru
DocumentRoot /home/romashka/primeval
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/romashka/primeval/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
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 /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

#CustomLog /var/log/apache2/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>



<VirtualHost *:81>
ServerAdmin webmaster@localhost
ServerName romartyn.ru
ServerAlias www.romartyn.ru
DocumentRoot /home/romashka/romartyn
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/romashka/romartyn/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
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 /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

#CustomLog /var/log/apache2/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>





<VirtualHost *:81>
ServerAdmin webmaster@localhost
ServerName footblog.ru
ServerAlias www.footblog.ru
DocumentRoot /home/romashka/footblog
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/romashka/footblog/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
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 /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

#CustomLog /var/log/apache2/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>
Re: Проблема подключения хоста
March 21, 2011 01:14PM
UP!
Re: Проблема подключения хоста
March 22, 2011 10:39AM
а что у Вас в логах?
Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 321
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready