Expectativa: localhost:3000
funciona com ip.ip.ip.ip/folder
Realidade: ip.ip.ip.ip/folder
é aberto, mas contém ip.ip.ip.ip/css/style.css
e o mesmo para links JS e outros.
Objetivo: algo (apache conf?) reescreve as coisas de tal forma que todos os links são ip.ip.ip.ip/folder/css/style.css
e JS e assim por diante.
Parece que deve funcionar como o localhost: 3000 não está usando URLs de parentes, mas de alguma forma isso não acontece.
O que não estou entendendo e como posso corrigi-lo?
Site:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
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>
RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 3
RewriteRule ^/folder/(.*)$ http://127.0.0.1:3000/$1 [L,P]
ProxyPassReverse /folder/ http://127.0.0.1:3000/
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>
Módulos apache carregados (provavelmente alguns demais, eu tentei um monte de coisas):
core_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
mime_module (shared)
negotiation_module (shared)
php5_module (shared)
proxy_module (shared)
proxy_html_module (shared)
proxy_http_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
status_module (shared)
substitute_module (shared)
editar:
Saída Rewritelog:
(2) init rewrite engine with requested uri /folder/
(3) applying pattern '^/folder/(.*)$' to uri '/folder/'
(2) rewrite '/folder/' -> 'http://127.0.0.1:3000/'
(2) forcing proxy-throughput with http://127.0.0.1:3000/
(1) go-ahead with proxy request proxy:http://127.0.0.1:3000/ [OK]
(2) init rewrite engine with requested uri /css/style.css
(3) applying pattern '^/folder/(.*)$' to uri '/css/style.css'
(1) pass through /css/style.css
Editar:
Encontrou alguns bons recursos e soluções:
Ainda lutando para não reescrever as URLs dentro do CSS.