-1

I came across this link: Can a website subdirectory be served by a different web server?

My question is a more specific. Can a sub subdirectory be served on AWS if the domain is served elsewhere?

I was looking at using Amazon Lightsail to spin up a Wordpress blog.

Has anyone managed it and is it possible? ie. mydomain.com/blog to go on AWS. mydomain.com served elsewhere.

What configuration would I have to do on the AWS side if possible? Would I be looking at going down a different route instead of Amazon Lightsail?

Buh Buh
  • 7,443
  • 1
  • 34
  • 61
Sandy
  • 19
  • 4
  • 1
    An easier alternative is to host your blog on a subdomain, `blog.mydomain.com` then it's just normal DNS rules and no proxy. – Buh Buh Aug 22 '22 at 11:04
  • I agree @BuhBuh . This is very unlikely in this circumstance though. – Sandy Aug 22 '22 at 11:14

1 Answers1

0

The answer is still a reverse proxy on your mydomain.com server,

If you are using NGINX on your domain side of things for example, you would do something like:

location /blog/ {
    proxy_pass http://url-to-aws/blog/ ;
}

You can refer to the NGINX docs here: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

Or if you are using Apache on your domain server, you can find their docs here: https://httpd.apache.org/docs/2.0/mod/mod_proxy.html

The AWS side of things would just be a normal setup with no additional configurations.

rrswa
  • 1,005
  • 1
  • 9
  • 23
  • Just to be clear, the guys hosting the domain would have to do 'reverse proxy' on their side. for the Amazon Lightsail side of things I would also need to configue Apache. Would virtual hosts need to be created? – Sandy Aug 22 '22 at 11:17
  • The Amazon Lightsail side of things would be a normal webserver, however you decide to set that up. The hosting domain side of things would set up a reverse proxy that forwards to the AWS lightsail site. – rrswa Aug 22 '22 at 11:44