ReverseProxy
Apache
simple.
<VirtualHost *:80>
ServerName doc.7kai.org
ProxyRequests Off
ProxyPass / http://localhost:5000/ retry=0
ProxyPassReverse / http://localhost:5000/
</VirtualHost>
high performance.
<VirtualHost *:80>
ServerName doc.7kai.org
DocumentRoot /home/aska/app-markdown-binder-plack/cache
<Directory /home/aska/app-markdown-binder-plack/cache>
Order allow,deny
Allow from all
</Directory>
Alias /favicon.ico /home/aska/app-markdown-binder-plack/htdocs/favicon.ico
Alias /robots.txt /home/aska/app-markdown-binder-plack/htdocs/robots.txt
Alias /static/ /home/aska/app-markdown-binder-plack/htdocs/static/
<Directory /home/aska/app-markdown-binder-plack/htdocs>
Order allow,deny
Allow from all
</Directory>
ProxyRequests Off
ProxyPass /favicon.ico !
ProxyPass /robots.txt !
ProxyPass /static/ !
ProxyPassMatch \.html$ !
ProxyPass / http://localhost:5000/ smax=10 max=20 retry=0 keepalive=Off
ProxyPassReverse / http://localhost:5000/
</VirtualHost>
Plack
look for X-Forwarded-For header in the incomming request and change REMOTE_ADDR to the real client IP.
cpanm Plack::Middleware::XForwardedFor
REVERSEPROXY=1 plack