Wordpress nginx是';加载(包括其他主机/*.conf;)不会更改目录吗?世纪7
我是Linux新手,在设置我的web服务器时遇到了一些问题。。。我使用LEMP与清漆和phpMyAdmin。服务器正在运行,我可以通过https等访问phpMyAdmin。现在我正在尝试使用include/directory/*.conf在另一个目录上设置Wordpress;但是,它似乎没有加载文件。它将只加载nginx.conf中设置的默认目录 这是我的nginx.confWordpress nginx是';加载(包括其他主机/*.conf;)不会更改目录吗?世纪7,wordpress,nginx,varnish,php,centos7,Wordpress,Nginx,Varnish,Php,Centos7,我是Linux新手,在设置我的web服务器时遇到了一些问题。。。我使用LEMP与清漆和phpMyAdmin。服务器正在运行,我可以通过https等访问phpMyAdmin。现在我正在尝试使用include/directory/*.conf在另一个目录上设置Wordpress;但是,它似乎没有加载文件。它将只加载nginx.conf中设置的默认目录 这是我的nginx.conf user nginx; worker_processes 4; error_log /var/log/nginx
user nginx;
worker_processes 4;
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;
keepalive_timeout 65;
include /etc/nginx/v-hosts/*.conf;
index index.php index.html index.htm;
server {
listen 127.0.0.1:8080;
root /usr/share/nginx/html;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/stolenmx.com/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /srv/www/;
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 443;
client_max_body_size 80M;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/;
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}
}
这是我要为wordpress加载的文件
server {
server_name stolenmx.com;
listen 8080;
access_log /var/log/nginx/stolenmx.com-access.log;
error_log /var/log/nginx/stolenmx.com-error.log;
root /srv/www/stolenmx.com;
location / {
index index.php;
}
# Disable favicon.ico logging
location = /favicon.ico {
log_not_found off;
access_log off;
}
# Allow robots and disable logging
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Enable permalink structures
if (!-e $request_filename) {
rewrite . /index.php last;
}
# Handle php requests
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/stolenmx.com$fastcgi_script_name;
}
# Disable static content logging and set cache time to max
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
# Deny access to htaccess and htpasswd files
location ~ /\.ht {
deny all;
}
}
我已经在nginx.conf“include/etc/nginx/v-hosts/*.conf”中包含了这个文件目录,但由于某些原因,它没有加载它,也不会将服务器名称指向/srv/www/
有人对它为什么不加载额外的server.conf有什么建议吗
我可以将wordpress安装拖到/usr/share/nginx/html中,它可以工作,但是我不能有多个服务器。我认为这与我的nginx.conf有关,但不确定要更改/添加什么
在更改影响您之前,您需要重新启动/重新加载nginx,在CentOS中,通过运行以下命令完成:
/etc/init.d/nginx restart
(如果您不是root用户,请使用sudo)
您要求所有包含的文件都以“.conf”作为后缀,请确保您的文件具有此扩展名。最后一件事,您将Wordpress服务器配置为在8080上侦听,是否检查了此端口?Hi,我已多次使用“systemctl restart nginx”重新启动nginx,但仍然没有更改,该文件为100%.conf,因为它是一个服务器配置文件,必须是此扩展名。最后,我使用varnish cache,它运行并显示端口80上的缓存文件,但侦听8080上的实时站点,以便缓存它。