Добрый день,в linux новичок нужна помощь.
Вот составил конфиг для Nginx,на сервере несколько доменов с поддоменами.
/etc/nginx/sites-available/mydomaine.ru
server {
listen 80 ;
listen [::]:80 ;
root /var/www/mydomaine.ru;
index index.html;
server_name mydomaine.ru;
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
# Some basic cache-control for static files to be sent to the browser
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}
server {
listen 80;
listen [::]:80;
root /var/www/login.mydomaine.ru;
index index.php index.html;
server_name login.mydomaine.ru login.www.mydomaine.ru;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}
Все работает кроме phpmyadmin ,на поддомене будет админка но после ввода login.myadmin.ru/phpmyadmin/
получаю такое
502 Bad Gateway
nginx/1.10.3 (Ubuntu)
вот логи
2018/03/21 10:45:49 [error] 26433#26433: *22 open() "/var/www/login.mydomaine.ru/favicon.ico" failed (2: No such file or directory), client: 50.40.30.20, server: login.mydomaine.ru, request: "GET /favicon.ico HTTP/1.1", host: "login.mydomaine.ru", referrer: "http://login.mydomaine.ru/phpmyadmin/"
2018/03/21 10:45:49 [error] 26433#26433: *22 connect() failed (111: Connection refused) while connecting to upstream, client: 50.40.30.20, server: login.mydomaine.ru, request: "GET /phpmyadmin/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "login.mydomaine.ru"
2018/03/21 10:45:50 [error] 26433#26433: *22 open() "/var/www/login.mydomaine.ru/favicon.ico" failed (2: No such file or directory), client: 50.40.30.20, server: login.mydomaine.ru, request: "GET /favicon.ico HTTP/1.1", host: "login.mydomaine.ru", referrer: "http://login.mydomaine.ru/phpmyadmin/"
2018/03/21 10:45:52 [error] 26433#26433: *22 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: Error in /var/www/login.mydomaine.ru/template/admin/login_form.php on line 5" while reading response header from upstream, client: 50.40.30.20, server: login.mydomaine.ru, request: "GET /admin.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "login.mydomaine.ru"
2018/03/21 10:45:53 [error] 26433#26433: *22 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: Error in /var/www/login.mydomaine.ru/template/admin/login_form.php on line 5" while reading response header from upstream, client: 50.40.30.20, server: login.mydomaine.ru, request: "GET /admin.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "login.mydomaine.ru"
2018/03/21 10:45:53 [error] 26433#26433: *26 open() "/var/www/login.mydomaine.ru/favicon.ico" failed (2: No such file or directory), client: 50.40.30.20, server: login.mydomaine.ru, request: "GET /favicon.ico HTTP/1.1", host: "login.mydomaine.ru", referrer: "http://login.mydomaine.ru/admin.php"
Если нужна еще информация пишите добавлю.