-1

I'm trying to do something that looks very difficult for me.

I need to embed a live blog remote HTML url inside my rails app and I don't want to use iframes for SEO.

I'm trying to use SSI.

I understand that I cannot use SSI with remote URL, but I'm trying to configure NGINX to have a local url that redirect to a remote url.

My liveblog url is something like this

https://liveblog.example.it/api/upload-raw/blogs/xxxxxxxxxx/index.html

I'm trying to add in nginx configuration something like this...

server {
....
  location /live_blog_embed {
    proxy_pass @live_blog; # or use "try_files" to provide fallback
  }

  location @live_blog {
    proxy_pass https://liveblog.example.it/api/upload-raw/blogs/xxxxxxxxxx/index.html;
  }
....
}

And then in my application

<!--# include virtual="/live_blog_embed?id=xxxxxx" -->

I cannot understand how can I pass my blog id from the html to the nginx configuration...

Any hint?

Roberto Pezzali
  • 141
  • 1
  • 1
  • 9

1 Answers1

0

Try using

proxy_pass https://liveblog.example.it/api/upload-raw/blogs/$arg_id/index.html;

The $arg_ prefix is used in nginx to use query arguments as variables.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63