apache - 如何使用 Apache httpd 将请求从一个特定端口转发到另一个端口?
问题描述
我的要求http://localhost/services/pdf/module/generate/
是
http://localhost:8080/services/pdf/module/generate/
写什么httpd.conf
来做到这一点。
解决方案
您可以使用以下重定向规则将请求从特定端口转发到另一个 Apache httpd。您可以根据需要调整端口。
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80
RewriteRule ^/(.*) http://%{HTTP_HOST}:8080/$1 [L,R]
推荐阅读
- python - 使用 Pandas 数据框和 PyPDF2 组合多个 PDF
- node.js - 在 mongodb localhost 中使用 code:62 关闭?
- powershell - 将 `Test-NetConnection` 与代理服务器一起使用
- google-tag-manager - 将 dataLayer 变量传递给 GTM 标签
- netcdf - 使用 ncks 的 4D netcdf 变量的 Hyperslab
- excel - 将 Excel 工作表加载到 netezza
- asp.net-mvc - HttpStatusCodeResult 消息编码
- php - Laravel 中的课程放在哪里?
- sql - 从 SQL 字段中删除特殊字符
- wordpress - WooCommerce:如何找到我为禁用“添加到购物车”功能而修改的一段代码?