Report this

What is the reason for this report?

How to setup sub-domain with nginx based on Angular app uri

Posted on September 19, 2017

This is my url: https://front.example.net/#/dashboard/partners/partner/{partner_name}/orders/list

I would like to setup subdomain for every {partner_name} via Nginx.

For example, instead of: https://front.example.net/#/dashboard/partners/partner/google/orders/list I want something like this: https://google.example.net/orders/list

Thank you!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

What I would suggest is creating server blocks for each subdomain name, that way you would have full control over how the content is being loaded.

For more information on how to setup server blocks I would recommend going through this guide here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.