我有一个使用nginx代理设置在主域上运行的nuxtjs应用https://damjanun.com/。现在,我们需要在子目录(即https://damjanun.com/blog)中安装wordpress。我做不完
找到了解决方案。这是我的damjanun.com的Nginx配置文件。该博客也可以正常运行https://damjanun.com/blog
location /blog {
try_files $uri $uri/ /blog/index.php?q=$1;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}