I have a website through Beanstalk that I use for work. I would like to use another website that forwards to a subdirectory of the current website.
So here's what I'd like:
x.abc.com exists. Page x.abc.com/y also exists
I want y.abc.com to forward to x.abc.com/y
I was hoping that a simple Beanstalk application could be made that would work out well. The simpler, the better. I'm open to all options though
This really depends on your setup. Is y.abc.com an actual domain that is up and running? What type of webserver is running on x.abc.com (apache, nginx)? You could possibly just modify the config for the x.abc.com webserver to answer for y.abc.com and do a rewrite rule for y.abc.com to do your forwarding.
Related
We are currently developing a CMS for our clients. We would like to host all their pages on our server like this:
https://www.example.com/client1website or https://www.example.com/client2website.
Is there a simple way to redirect content from https://www.example.com/client1website to https://www.theirdomain.com?
I know that Heroku or Wix work in a similar way, but I don't really know how to achieve it. Setting the CNAME for www to https://www.exmaple.com/client2website is probably not enough?
Godaddy can do https://www.client1website.example.com to https://www.theirdomain.com
But otherwise they are going to need to stop at your server first since you are pointing them down into your directory
You can redirect using status code 308
I'm moving from Apache on Linux to Azure Web Apps and I have a specific url (mysite.com/blog and everything under it) that is configured with a reverse proxy so the end user doesn't know that the content is actually coming from another service.
I'm sure I can do this within Web Apps (which runs on IIS) but I can't find any documentation on how to do this. As a backup I'm open to putting another service in front of my Web App.
How can I accomplish this in Azure?
Update: I did try using another service - Functions. My architecture looks like this:
This works in production but I'm hitting snags in development. /blog may or may not work depending on the entry point. In prod, our DNS will be configured so mysite.com points to mysite-proxy.azurewebsites.net and, therefore, any URI the user hits will work. In dev, however, we may want to browse to hit /blog from the Traffic Manager which will route us to /blog on the webapp which doesn't exist. Same problem, of course, if we go to /blog directly on the webapp. I tried to show these examples on the right side of the diagram.
I would like to find a solution so the webapp itself can handle the /blog proxying and then we can determine whether it's worth the speed and cost tradeoff compared to the existing solution.
You might want to checkout Azure Functions Proxies: https://learn.microsoft.com/en-us/azure/azure-functions/functions-proxies
Sounds like you want an Application Gateway (caution, costs like $15/day)
The AGW can have multiple listeners against multiple hostnames, including path-based routing.
You will want to add two backends, one for the /blog endpoint and one for the non-/blog stuff. The backends just take the IP or FQDN of the target resource, in this case you will have:
blogBackend: myblog.com
defaultBackend: myWebapp.azurewebsites.net
Then you need to add listeners for your public-facing domain, it would be like:
myHttpListener: port 80, hostname=mywebsite.net
myHttpsListener: port 443, hostname=mywebsite.net
Then you need an HTTP setting
myHttpSetting: protocol=HTTPS, port=443, useWellKnownCACert=Yes, HostnameOverride=Yes,pick from backend target
Then you need rules, one for http=>https redirect, and the other for handling the pathing
myRedirectRule: type=basic, listener=myHttpListener, backendtargettype=redirection, targettype=listener, target=myHttpsListener
myRoutingRule: type=path-based, listener=myHttpsListener, targettype=backendpool, target=defaultBackend, httpSetting=myHttpSetting, pathRules=
path=/* name=root backendpool=defaultBackend
path=/blog name=blog backendpool=blogBackend
You can create additional http settings and assign them to the path rules to change the behaviour of the reverse proxy. For example, you can have the user's URL be https://mywebsite.net/blog, but have the path stripped on the request to the blog so the request looks like myblog.com instead of myblog.com/blog
There's a lot of tiny parts, but the app gateways can handle multiple applications at scale. Biggest thing is to watch out for the cost since this is more of an enterprise solution.
I want to a specific folder on multiple domains, under the same nginx installation to use the same instance of a nodejs application.
I have the domains "domain1.com", "domain2.com" and "domain3.com", each with their own static files (only). What I want is that "http://domain1.com/feature" is handled by nodejs and "http://domain2.com/feature" is handled by the same app (memory and stuff) that handles "http://domain1.com/feature".
I don't mind creating another domain/subdomain to handle that, but I do not want to create any redirections (the user that uses domain1 should not be aware that domain2 exists and so on).
Can this be accomplished?
Thanks in advance.
Depends on the architecture of the application but you may want to proxy it using nginx's rewrite module, rewriting the URLs to use the same location but sharing the same back end URLs.
Here is my issue (keep in mind I am used to linux not windows servers): I have a website domain.com (.asp site) that is hosted on an IIS8 server and then a folder domain.com/folder that needs to point to a different servers IP address that holds a different site (linux server running Magento).
I know personally that a subdomain should have been created and DNS pointed to it correctly like folder.domain.com but I have inherited this issue and am trying to see if a solution is even possible.
Thank you all in advance.
I dont have previlage to comment in your question.! So I commenting here.!
Have you ever crossed symlinks? I hope you need the following link. The question is not clear though.
check this out.
Symlink created with mklink not working with IIS7.5 -- Windows 7
Responding as another team member on this project--
A 301 redirect is not a viable option by nature of Magento's URL request mechanism (if the request didn't originate from the URI set in the config, then redirect to it). We either end up with infinite loops, or IIS rewriting headers to trick Magento in to thinking the request URI is correct and performing a 301 redirect on every resource on the page (and the page itself, of course). This breaks miserably on POST requests.
We must be serving fully-qualified URLs from domain.com/folder/foo-bar.baz.
Switching to Linux is not possible. Please don't suggest what we already want.
Thanks, SO.
I'm currently learning node.js and loving it. I noticing, however, that it seems that's it's really only fit for one site. So it's great for hosting mydomain.com, but what if I want to build an actual full web server with it. In other words, I would like to host mydomain.com, example.com, yourdomain.com and so on. What solutions (modules) are available for this? I was thinking of simply parsing the url from the request object and simply reading from the appropriate directory. For example if I get a request for example.com then read from the example_com directory or if I get a request from mydomain.com read from the mydomain_com directory. The issue here is I don't know how this will affect performance and scalability.
I've looked into Multi-node but I don't fully follow the idea of processes yet (I'm a node beginner).
Any suggestions are welcome.
You can do this a few different ways. One way is to write it directly into your web application by checking what domain the request was made to and then route within your application but unless your application is very basic this can make it fairly bloated and can get messy. A good time to do something like this might be if you're writing a blogging platform where everything is pretty much the same across all your domains. The key difference might be how you query your data to display the right data.
In this case you'd probably use the request to see which blog is being accessed.
If you want to just host a few different domains on the same server all using port 80 (like most websites do) you will want to proxy each request off to a different process. You can do this with nginx or even with node itself. It all comes down to what best fits your needs. bouncy is a quick way to get setup doing this as its a nodejs module and has some pretty impressive benchmarks. nginx (proxy with nginx) is probably the most wildly used method though, as a lot of nodejs servers use nginx to serve static content anyways.
http://blog.noort.be/2011/03/07/node-js-on-nginx.html
https://github.com/substack/bouncy/
You can use connect's vhost middleware (which is also available in express) to dispatch requests to separate request handlers based on the Host: header. This assumes that everything is being handled by the same node process on the same port; if you really need separate processes, then the suggestion about using nginx as a reverse proxy is probably the way to go.