我的主要领域是示例。com公司
我已经在主域中实现了MEAN项目,现在我想要示例。wordpress安装程序的com/blog。
我在nginx配置文件中完成了以下配置
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
root /home/ubuntu/example/dist;
server_name example.com;
location / {
#proxy_pass https://example.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:3000;
}
location /blog {
alias /var/www/html/;
index index.php index.html index.htm;
try_files $uri $uri/ @blog;
location ~ \\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)
{
try_files $uri $uri/ =404;
}
}
location @blog {
rewrite /blog/(.*)$ /blog/index.php?q=$uri$args;
}
location ~ \\.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}
所有都是工作文件,但只有wp json url返回404