wordpress - Nginx:主域上的 Nuxtjs 应用程序 + 子目录中的 WordPress
问题描述
我有一个 nuxtjs 应用程序https://damjanun.com/使用 nginx 代理设置在主域上运行。现在我们需要在子目录中安装 wordpress,即:https ://damjanun.com/blog 。我无法完成它。
解决方案
找到了解决方案。这是我的 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;
}
推荐阅读
- performance - webgl中的什么命令导致纹理内存被处理
- amazon-s3 - 将实时视频从 Raspberry Pi 摄像头流式传输到 Android 应用程序
- hyperledger-fabric - HL Fabric - 织物安装*没有*织物样品?
- node.js - “需要登录”错误。使用 Google API 获取 oauth2 令牌后如何登录
- reactjs - 如何使用 create-react-app 用 AdonisJS 实现 ReactJS?
- javascript - 如何根据属性值过滤 MapBox 热图中的点?
- java - 为什么所有分区都没有分配给正在运行的单个 KafkaConsumer?
- spring - 如何修复这些警告消息——com.couchbase.client.deps.io.netty.util.IllegalReferenceCountException: refCnt: 0, increment: 1
- html - HtmlCleaner 不处理字符引用
- python-3.x - 使用 python 3.7 PyQt5 和 cx_Freeze 创建可执行文件,但 DLL 无法加载