如何解决重定向到Apache ReverseProxy之后
我的设置
我有一个Apache2(在Ubuntu服务器上为 2.4 )网络服务器,该服务器应在以下服务器上提供Django和Ruby Web应用程序:
- Ruby: localhost:7000
- Django: localhost:8000
- Django静态文件: localhost:9000
所有请求都传递到Ruby应用程序,但前面带有/django/
的请求。另一台服务器正在/static/
下提供静态文件。
我的基本虚拟主机设置
<VirtualHost *:443>
ServerAdmin some@email
ServerName example.com
DocumentRoot /var/www/html
# Logging
SSLEngine On
# SSL Certificates
SSLOptions +StdEnvVars
RequestHeader set X_FORWARDED_PROTO 'https'
ProxyPass /django/ http://localhost:8000/django/
ProxyPassReverse /django/ http://localhost:8000/django/
ProxyPass /static/ http://localhost:9000/static/
ProxyPassReverse /static/ http://localhost:9000/static/
ProxyPass / http://localhost:7000/
ProxyPassReverse / http://localhost:7000/
<Location />
ProxyHTMLURLMap "http://localhost:7000" "/"
ProxyPassReverse "/"
</Location>
</VirtualHost>
对不起
我必须包含ProxyHTMLURLMap
,因为当我的Ruby应用程序获得POST
时,我被重定向到localhost:7000
,这是从外部无法访问的。它似乎可以满足我的要求,但我对此不确定。
问题
我的Django应用程序确实使用 https://externalsite.com/somesite.php?added=load 重定向到了外部网站,该网站现在已重定向到 https://example.com/somesite.php?added=load 。
如果有人能对这个问题有所了解,我将非常感激。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。