Q: What cloudflare pagerule can make a subdomain appears like a url path under the main domain? I have some tumblr contents living on a site called lovely.mycompany.com
What I would like to achieve is the following:

When a user visits lovely.mycompany.com/lovely, it should see the
  content of under  lovely.mycompany.com.
If a user visits www.mycompany.com/lovely/what-a-day, it should
  display content of  lovely.mycompany.com/what-a-day.

There are a few catches:
1) lovely.mycompany.com is set to HTTPS only but lovely.mycompany.com only supports http
2) lovely.mycompany.com is actually hosted on tumblr. Sometimes a redirection may result in https://www.tumblr.com/lovely with the message There's nothing here.
3) It does not support urls like lovely.mycompany.com/what-a-day
I have tried the following set of page rules (output of the cloudflare pagerule api)
// First rule
{u'actions': [{u'id': u'forwarding_url',
               u'value': {u'status_code': 301,
                          u'url': u'https://mycompany.com/lovely'}}],
 u'created_on': u'2018-04-20T04:51:49.000000Z',
 u'id': u'023d520352f1afd893265bf2601e5459',
 u'modified_on': u'2018-04-20T05:17:08.000000Z',
 u'priority': 8,
 u'status': u'active',
 u'targets': [{u'constraint': {u'operator': u'matches',
                               u'value': u'mycompany.com/lovely'},
               u'target': u'url'}]}


// Second rule
{u'actions': [{u'id': u'browser_cache_ttl', u'value': 60},
              {u'id': u'cache_level', u'value': u'cache_everything'},
              {u'id': u'resolve_override',
               u'value': lovely.mycompany.com'},
              {u'id': u'host_header_override',
               u'value': u'lovely.mycompany.com'}],
 u'created_on': u'2018-04-20T04:51:41.000000Z',
 u'id': u'b3b87d2f17a924b010538ce7ce4e8a81',
 u'modified_on': u'2018-04-20T05:17:08.000000Z',
 u'priority': 1,
 u'status': u'active',
 u'targets': [{u'constraint': {u'operator': u'matches',
                               u'value': u'www.mycompany.com/lovely/*'},
               u'target': u'url'}]}

How can I overcome these issues and achieve my goals?

A: You could do this with Cloudflare Workers, which lets you write JavaScript code to handle requests to your site. Workers allow you to rewrite requests and send them to other servers.
Here's a script that does what you describe:
addEventListener('fetch', event => {
  event.respondWith(handle(event.request))
})

/**
 * @param {Request} request
 */
async function handle(request) {
  let url = new URL(request.url)
  if (url.pathname.startsWith("/lovely/")) {
    url.protocol = "http:"
    url.host = "lovely.mycompany.com"
    url.pathname = url.pathname.slice("/lovely".length)
    return fetch(url, request)
  } else if (url.pathname.startsWith("/what-a-day/")) {
    url.protocol = "http:"
    url.host = "lovely.mycompany.com"
    return fetch(url, request)
  } else if (url.pathname == "/lovely" ||
             url.pathname == "/what-a-day") {
    // Redirect to add trailing /.
    url.pathname += "/"
    return Response.redirect(url, 301);
  } else {
    return fetch(request)
  }
}

Keep in mind, of course, that the above does not rewrite any links, image URLs, etc. that appear within the page's HTML. This could result in the page content being broken. For example if it contains an image tag like <img src="/some-image.jpg">, then this will try to load the image from www.mycompany.com/some-image.jpg which won't work. You could extend your code further to cover all possible asset URLs. Or, you could actually write a Worker that rewrites the content of the HTML page -- but this will be a lot more involved. Here's a simple example of modifying page content.
That said, Tumblr seems to mostly reference assets from other origins so you might be OK without modifying the page content. You can use the Cloudflare Workers Playground to try it out right now and see if it works.
