Why ww2 sub domains?

People running large(-ish) sites used to do this when they needed to break up the load between more than one server. One machine would be called www then the next one would be called www2, etc. Today, much better load balancing solutions are available that don’t require you to expose your internal machine naming conventions … Read more

Why use subdomains to designate tenants in a multi-tenant web application?

There are several ways to determine tenant on HTTP level: domain – tenant is determined by whole Host header sub-domain – sub-domain part of Host header, path based – path segment, usually by prefix host.com/tenantId/… cookie based – cookie value contains tenant id (good framework encrypts this!) user based – user session or some data … Read more

Dynamic Subdomain Handling in a Web App (Flask) [closed]

All Flask’s routing constructs support the subdomain keyword argument (this includes support for route variables). @app.route(“https://stackoverflow.com/”, subdomain=”static”) def static_index(): “””Flask supports static subdomains This is available at static.your-domain.tld””” return “static.your-domain.tld” @app.route(“/dynamic”, subdomain=”<username>”) def username_index(username): “””Dynamic subdomains are also supported Try going to user1.your-domain.tld/dynamic””” return username + “.your-domain.tld”

Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them?

Okay, after doing some research I’ve found out that opening ports in Heroku is disabled and not allowed. The only way around this is to use sub-domains and then in-app to use a proxy module (like subdomain-router which I use). BUT – Heroku don’t let you create sub-domains on their domain, meaning that your-app.herokuapp.com is … Read more

Can subdomain.example.com set a cookie that can be read by example.com?

Yes. If you make sure to specify that the domain is .example.com, then *.example.com and example.com can access it. It’s that principle that allows websites that issue cookies when somebody goes to www.website.com to access cookies when someone leaves off the www, going to website.com. EDIT: From the PHP documentation about cookies: domain The domain … Read more

How to test nginx subdomains on localhost

Yes, add ‘127.0.0.1 sub.localhost’ to your hosts file. That sub has to be resolved somehow. That should work. Then once you’re ready to go to the net, yes, add an a or cname record for the subdomain sub. When I use proxy_pass I also include the proxy.conf from nginx. http://wiki.nginx.org/HttpProxyModule