| zavndw |
|
Темы:
4
Сообщения:
27
Участник с: 15 октября 2011
|
Помогите разобраться с проблемой, не работает пхп на nginx. сделал все по мануалу и ни чего не работает, сам веб сервер работает, виртуальные хосты то же, порт php-fpm слушает, в конфиге веб сервера прописан, в логе пусто Глобально не указывается настройка пхп! |
| vdemin |
|
Темы:
54
Сообщения:
1615
Участник с: 24 января 2009
|
Хотелось бы взглянуть на конфиги nginx'a. |
| zavndw |
|
Темы:
4
Сообщения:
27
Участник с: 15 октября 2011
|
#user www;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
#
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
server {
listen 80;
server_name kav.domane.local kav;
location / {
root /srv/http/kav/Updates/;
index index.html index.htm;
}
}
server {
listen 80;
server_name dc.domane.local dc;
location / {
root /srv/http/dc/;
index index.html index.htm;
}
}
server {
listen 80;
server_name mirror.domane.local mirror;
location / {
root /srv/http/mirror/;
}
}
server {
listen 80;
server_name test.domane.local test;
#location / {
# root /srv/http/test/;
#}
location / {
root /srv/http/test/;
index index.php;
}
}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
} |
| Natrio |
|
|
Темы:
47
Сообщения:
4763
Участник с: 08 января 2011
|
У вас php прописан только для первого хоста, и то почему-то в каталоге scripts |
| vdemin |
|
Темы:
54
Сообщения:
1615
Участник с: 24 января 2009
|
Natrio, Похоже, просто раскомментарены строки в дефолтном конфиге. ZavNDW, Пропишите php для каждого нужного вам сервера след. образом: server {
listen 80;
server_name ИМЯ_СЕРВЕРА;
root ПУТЬ_К_КАТАЛОГУ;
location / {
index index.php index.html index.htm;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass 127.0.0.1:9000;
}
# остальная часть конфига
# ....
} |
| zavndw |
|
Темы:
4
Сообщения:
27
Участник с: 15 октября 2011
|
Спасибо большое понял свою ошибку |