Ich bin ziemlich neu in Nginx und ich habe ein Problem damit. Ich habe zwei WordPress-Websites und möchte sie mit Nginx auf einem Centos-Linux starten. Was ich getan habe ist:Mehrere PHP-basierte Server-Blöcke in Nginx - 404 Fehler
- Schaffung sites-available und sites-enabled in der Datei/etc/nginx/
- meine Website Konfigurationsdateien anlegen (Conf) in sites-available
- ich symbolische Links erstellt für sie
ln -s
Meine Konfigurationsdateien sind wie folgt: nginx.conf
http {
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;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
# include /etc/nginx/conf.d/*.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location/{
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;
}
mydomain1.com.conf
server {
listen 80;
server_name mydomain1.com www.mydomain1.com;
location/{
root /var/www/html/;
index index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
mydomain2.com.conf
server {
listen 80;
server_name mydomain2.com www.mydomain2.com;
location/{
try_files $uri $uri/ =404;
root /var/www/aramis;
index index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
/etc/php-fm.d/www.conf
[www]
listen = /var/run/php-fpm/php-fpm.sock
listen.allowed_clients = 127.0.0.1
listen.owner = nobody
listen.group = nobody
;listen.mode = 0660
user = nginx
group = nginx
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
Ich habe es auch versucht php-fpm.sock zu finden, aber ich war nicht erfolgreich. Was ich bekomme, wenn ich versuche, meine Webseiten vom Browser aus zu sehen, ist 404 Error.
Sie wären besser dran auf [sf] fragen. Aber kreuzen Sie nicht an. – miken32
Was haben die NGINX-Zugriffsprotokolle? –
Es zeigt nur meine Versuche, meine Websites zu sehen – Mahdi