Question

Running Java+Angular app and wordpress on same droplet and same domain

Posted April 7, 2020 165 views
WordPressJava

Hello,
I want to run my existing java+angular app as well as Wordpress app on same droplet. I have seen multiple examples to do same thing with two different domains. However i want to run wordpress on https://domain.com and angular+java app on https://mydomain.com/app.
I am using nginx as server for my java+angular app which is currently deployed at https://mydomain.com
Please help!

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.

×
1 answer

When using Nginx or any other service you can use Vhosts to get what you want.
Have one directory listen to a specific /folder and the other to another. We need some specific information here however to help you on this specific request;

  • What does your current nginx file look like?
  • Where are the different webserver files located?
  • Does the angular service run a different port?

Let me know if this helps you or got any more questions.

  • Hello,
    Thanks for reply

    1>I have a java sprint boot API which works at localhost:8999

    2> I have Angular app which needs to be hosted at mydomain.com/app. Angular app internally calls spring boot api . at mydomain.com/app/api which i need to redirect to above api at localhost :8999

    3> My WordPress needs to be hosted at mydomain.com

    I want to to make this configuration.
    Please help me understand how will my Nginx configuration should look like

    NOTE: i used digital ocean one click installer to install lemp stack . so i have barebones lemp ready where i can install wordpress in root path (mydomain.com)

Submit an Answer