
我有標準的 Apache 配置。 Apachedomain.com
提供靜態 html 檔案(無後端技術)
在domain.com:2368
,有一個 Ghost(部落格平台)實例,運行 NodeJS。
我想要達到以下效果:
人們應該進入 at,domain.com/blog
並且它應該將(內容,而不是 URL)重新導向到特定連接埠上的 Ghost 實例。
到目前為止,我已經成功地blog.domain.com
指向了 Ghost,但我/blog
也想工作。
這是我的主要 VH:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /srv/www/htdocs/domain.com/
ServerName domain.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /srv/www/htdocs/domain.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
這是將連接埠重定向到 blog.domain.com 的附加 VH
<VirtualHost *:80>
ServerName blog.domain.com
ProxyPass / http://127.0.0.1:2368/
ProxyPassReverse / http://127.0.0.1:2368/
ProxyPreserveHost On
</VirtualHost>
答案1
Ghost 在 0.4 中加入了對此的支援 -https://github.com/TryGhost/Ghost/wiki/Release-Notes:-0.4.0