Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Вот фрагмент файла var/log/nginx/error.logПокажи лог nginx, такое чуство, что у него неправильно указана директория где лежат файлы сайта...
2012/06/25 20:42:09 [emerg] 8167#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to Server_IP_1:443 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to Server_IP_2:443 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to Server_IP_1:443 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to Server_IP_2:443 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to Server_IP_1:443 failed (98: Address already in use)
2012/06/25 20:42:09 [emerg] 8167#0: bind() to Server_IP_2:443 failed (98: Address already in use)
2012/06/25 20:44:39 [error] 8172#0: *11 open() "/var/www/user/data/www/site.ru/templates/css/style.css" failed (13: Permission denied), client: Client_IP, server: site.ru, request: "GET /templates/css/style.css HTTP/1.1", host: "www.site.ru", referrer: "http://www.site.ru/"
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /usr/local/ispmgr/etc/nginx.domain;
client_max_body_size 16M;
log_format isp '$bytes_sent $request_length';
server {
server_name site2.ru www.site2.ru;
listen Server_IP_2;
listen Server_IP_2:443;
disable_symlinks if_not_owner from=/var/www/site2user/data/www/site2.ru;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/site2user/data/www/site2.ru;
access_log /var/www/nginx-logs/site2user isp;
access_log /var/www/httpd-logs/site2.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://Server_IP_2:81;
proxy_redirect http://Server_IP_2:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://Server_IP_2:81;
proxy_redirect http://Server_IP_2:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location @fallback {
proxy_pass http://Server_IP_2:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
include /usr/local/ispmgr/etc/nginx.inc;
ssl_certificate /var/www/httpd-cert/site2user/site2.ru.crt;
ssl_certificate_key /var/www/httpd-cert/site2user/site2.ru.key;
}
server {
server_name site1.ru www.site1.ru;
listen Server_IP_1;
listen Server_IP_1:443;
disable_symlinks if_not_owner from=/var/www/site1user/data/www/site1.ru;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/site1user/data/www/site1.ru;
access_log /var/www/nginx-logs/site1user isp;
access_log /var/www/httpd-logs/site1.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://Server_IP_1:81;
proxy_redirect http://Server_IP_1:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://Server_IP_1:81;
proxy_redirect http://Server_IP_1:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location @fallback {
proxy_pass http://Server_IP_1:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
include /usr/local/ispmgr/etc/nginx.inc;
ssl_certificate /var/www/httpd-cert/site1user/site1.ru.crt;
ssl_certificate_key /var/www/httpd-cert/site1user/site1.ru.key;
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 20472 root 22u IPv4 33363966 0t0 TCP *:www (LISTEN)
nginx 20473 nginx 22u IPv4 33363966 0t0 TCP *:www (LISTEN)
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apache2 21624 root 3u IPv4 33379922 0t0 TCP *:81 (LISTEN)
apache2 21625 www-data 3u IPv4 33379922 0t0 TCP *:81 (LISTEN)
apache2 21633 www-data 3u IPv4 33379922 0t0 TCP *:81 (LISTEN)
apache2 21635 www-data 3u IPv4 33379922 0t0 TCP *:81 (LISTEN)
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 20472 root 23u IPv4 33363967 0t0 TCP ServerName.ru:https (LISTEN)
nginx 20472 root 24u IPv4 33363968 0t0 TCP ServerName.ru:https (LISTEN)
nginx 20473 nginx 23u IPv4 33363967 0t0 TCP ServerName.ru:https (LISTEN)
nginx 20473 nginx 24u IPv4 33363968 0t0 TCP ServerName.ru:https (LISTEN)
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 20472/nginx.conf
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 21624/apache2
tcp 0 0 Server_IP_2:443 0.0.0.0:* LISTEN 20472/nginx.conf
tcp 0 0 Server_IP_1:443 0.0.0.0:* LISTEN 20472/nginx.conf
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 15572/sendmail: MTA
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 13888/named
tcp 0 0 Server_IP_2:443 0.0.0.0:* LISTEN 20472/nginx.conf
tcp 0 0 Server_IP_1:443 0.0.0.0:* LISTEN 20472/nginx.conf
tcp 0 0 Server_IP_1:1500 0.0.0.0:* LISTEN 1984/ihttpd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 1423/smbd
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 15501/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 15501/dovecot
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 14115/mysqld
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 15572/sendmail: MTA
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 13753/memcached
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1423/smbd
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 15501/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 15501/dovecot
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 20472/nginx.conf
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 21624/apache2
tcp 0 0 Server_IP_2:53 0.0.0.0:* LISTEN 13888/named
tcp 0 0 Server_IP_1:53 0.0.0.0:* LISTEN 13888/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 13888/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1965/sshd
tcp6 0 0 ::1:953 :::* LISTEN 13888/named
tcp6 0 0 :::21 :::* LISTEN 15594/proftpd: (acc
tcp6 0 0 :::53 :::* LISTEN 13888/named
tcp6 0 0 :::22 :::* LISTEN 1965/sshd
unix 2 [ ACC ] STREAM LISTENING 32400538 14115/mysqld /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 32405105 15501/dovecot /var/run/dovecot/dict-server
unix 2 [ ACC ] STREAM LISTENING 33302230 20303/ispmgr tmp/ispmgr.sock
unix 2 [ ACC ] STREAM LISTENING 32405107 15501/dovecot /var/run/dovecot/login/default
unix 2 [ ACC ] STREAM LISTENING 33302232 20303/ispmgr tmp/ispmgr.adm.sock
unix 2 [ ACC ] STREAM LISTENING 32405112 15501/dovecot /var/run/dovecot/auth-worker.15502
unix 2 [ ACC ] STREAM LISTENING 33394033 21636/php-cgi /var/lib/apache2/fcgid/sock/21625.0
unix 2 [ ACC ] STREAM LISTENING 35156424 25742/php-cgi /var/lib/apache2/fcgid/sock/21625.1
unix 2 [ ACC ] STREAM LISTENING 35336210 25921/php-cgi /var/lib/apache2/fcgid/sock/21625.2
unix 2 [ ACC ] STREAM LISTENING 35843378 26253/php-cgi /var/lib/apache2/fcgid/sock/21625.3
unix 2 [ ACC ] STREAM LISTENING 28581566 1443/saslauthd /var/run/saslauthd/mux
unix 2 [ ACC ] STREAM LISTENING 32405779 15572/sendmail: MTA /var/run/sendmail/mta/smcontrol
server {
server_name site2.ru www.site2.ru;
listen 80;
disable_symlinks if_not_owner from=/var/www/site2user/data/www/site2.ru;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/site2user/data/www/site2.ru;
access_log /var/www/nginx-logs/site2user isp;
access_log /var/www/httpd-logs/site2.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://Server_IP_2:81;
proxy_redirect http://Server_IP_2:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://Server_IP_2:81;
proxy_redirect http://Server_IP_2:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location @fallback {
proxy_pass http://Server_IP_2:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
server_name site1.ru www.site1.ru;
listen 80;
disable_symlinks if_not_owner from=/var/www/site1user/data/www/site1.ru;
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /var/www/site1user/data/www/site1.ru;
access_log /var/www/nginx-logs/site1user isp;
access_log /var/www/httpd-logs/site1.ru.access.log ;
error_page 404 = @fallback;
}
location / {
proxy_pass http://Server_IP_1:81;
proxy_redirect http://Server_IP_1:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^/(webstat|awstats|webmail|myadmin|pgadmin)/ {
proxy_pass http://Server_IP_1:81;
proxy_redirect http://Server_IP_1:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location @fallback {
proxy_pass http://Server_IP_1:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}
Для линукса - так и есть, как минимум для Дебиана так точно...но, если я не ошибаюсь бинд портов пол линуксом ниже 1024 разрешен только руту.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 20472 root 23u IPv4 33363967 0t0 TCP ServerName.ru:https (LISTEN)
nginx 20472 root 24u IPv4 33363968 0t0 TCP ServerName.ru:https (LISTEN)
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 20472 root 22u IPv4 33363966 0t0 TCP *:www (LISTEN)