node.js - 如何使用 nginx 和 apache 配置服务器?
问题描述
我已经安装了非常旧的安装了 apache 和 wordpress 的 centOs 服务器。我试图在上面安装 nginx 并遇到了问题: - apache 在端口 80 上工作 - nginx 在端口 81 上这个 nginx 配置,我只是把所有东西都放到一个配置文件中(没有 site_avialialbe)
```
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 81;
server_name localhost;
root /usr/share/api;
location / {
proxy_pass http://127.0.0.1:3001;
root /usr/share/api;
index index.html index.htm;
}
}
}
```
我的节点 js 应用程序使用 pm2 并使用本地地址 localhost:3001
当我开始一切,并打电话
wget localhost:3000
它只是返回我 504 错误。
例如,如果我尝试添加一些子域 api.something.com 它会自动将我重定向到带有 wp 网站的主域
我在哪里犯错了?
解决方案
已修复,iptables配置有问题,谢谢大家帮忙
推荐阅读
- python - Python - PermissionError: [WinError 32] 该进程无法访问该文件,因为它正被另一个进程使用:
- reactjs - React Native - 如何启用调试样式/ UI 检查器?
- php - Mpdf没有在PHP中输出多个具有相同名称的输入
- laravel - [Vue 警告]:编译模板时出错:无效表达式:意外令牌 >
- docker - 如何防止 Docker 构建创建新步骤?
- java - 第二最短/第k最短路径
- google-apps-script - 计算 TeamDrive 中的文件
- python - AttributeError:“SARIMAXResults”对象没有“附加”属性
- c++ - Clang 无法在 std::function 实例化中扩展参数包
- excel - 根据 Excel 中单独列的条件生成随机列表