nginx - 如何根据动态 url 参数配置 nginx proxy_pass?
问题描述
解决方案
好的。我找到了。我在站点可用和站点启用中使用 default.conf。这是修改 default.conf 的错误位置。正确的路径是修改 conf.d 目录中的 default.conf。
1) install nginx
2) run:
nginx -v
(nginx version: nginx/1.15.5)
3) sudo nano /etc/nginx/conf.d/default.conf
server {
listen 80;
listen [::]:80;
error_log /var/log/nginx/your_domain_name.error.log debug;
rewrite_log on;
server_name your_domain_name;
location / {
proxy_pass http://127.0.0.1:8888/;
}
}
4) sudo systemctl reload nginx
5) sudo systemctl restart nginx
6) sudo nginx -t
7) curl http://your_domain_name/
推荐阅读
- android - 通知托盘中的 Android Bot 而不是启动器图标 - FCM
- javascript - Angular 7:更新的 systemjs.config.js 是什么?
- javascript - 测试:62 未捕获的 ReferenceError:未在 HTMLButtonElement.onclick 中定义(测试:62)
- azerothcore - 如何禁用实例?
- objective-c - 如何让 IOS 应用程序信任本地主机以进行开发 API
- angular-material - 加载带有多个选项的材质选择并选中某些选项?
- android - 使用 Kotlin 在 Android Studio 中返回当前日期
- c++ - BinomialBlurImageFilter 将内核应用于图像
- javascript - 如何更改属于 JS/jQuery 中特定行的按钮文本?
- html - 如何在具有嵌套弹性盒的弹性盒子项之间均匀分布宽度?