Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Can we use tomcat and apache as middleware in rendertron instead of express? #235

Closed
varajcs opened this issue Nov 13, 2018 · 4 comments
Closed

Comments

@varajcs
Copy link

varajcs commented Nov 13, 2018

I tried using this in url rewrite in
Tomcat

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ https://render-tron.appspot.com/http://example.com/$1? [R,L]

For Apache
`

RewriteEngine On
<IfModule mod_proxy_http.c>
    RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator [NC,OR]
    RewriteCond %{QUERY_STRING} _escaped_fragment_
    
    RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff))(.*) https://render-tron.appspot.com/http://example.com/$2 [P,L]
</IfModule>

`

It's not working properly.

@tsujihidetaka
Copy link

What is a problem?

@varajcs
Copy link
Author

varajcs commented Feb 15, 2019

I tried using rendertron to solve angularjs URL share with image preview in social media (Facebook, Twitter, Linkedin). By using the above rewrite rule. But the rendertron site not returned response to bot. so how to do that? using rewrite rule for proxy rendertron when bot crawl for sharing.

@tsujihidetaka
Copy link

In my case, SSLProxyEngine was off.
So I wrote "SSLProxyEngine on" in httpd.conf
Also I wrote RewriteCond and RewriteRule as above in httpd.conf
It works for me.

@varajcs
Copy link
Author

varajcs commented Feb 18, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants