我正在考虑修改.htaccess文件以创建反向代理,或者转发Yii中的请求,但我不确定。它可能类似于这个答案,但对于PHP而不是Rails。
How can I use a subdirectory instead of a subdomain?
是否有用于PHP / Yii的标准Composer插件来设置反向代理?
答案 0 :(得分:0)
Procfile
web: vendor/bin/heroku-php-apache2 -l runtime/logs/app.log -C httpd_include.conf web/
httpd_include.conf
DirectoryIndex index.php index.html index.htm
# For blog
LoadModule proxy_html_module libexec/mod_proxy_html.so
LoadModule ssl_module libexec/mod_ssl.so
LoadModule xml2enc_module libexec/mod_xml2enc.so
SSLProxyEngine on
ProxyRequests off
ProxyPass /blog https://shopwiz2.wordpress.com
ProxyPassReverse /blog https://shopwiz2.wordpress.com
ProxyHTMLURLMap https://shopwiz2.wordpress.com /blog
<Location /blog>
ProxyPassReverse /
ProxyHTMLEnable On
ProxyHTMLURLMap / /blog
RequestHeader unset Accept-Encoding
#LogLevel proxy:debug
</Location>
参考: