How to setup two different apps on a single droplet through two different subdomain?

Hi, im trying to make this work since last 4 days… Can anybody guide me pls.

  1. I have domain using a nameserver outside digitalocean.

  2. Through DNS management i create “A Record” of and pointing to a droplet public IP. The record i created is as follow     A 14400 dropletipv4 A 14400 dropletipv4     A 14400 dropletipv4 A 14400 dropletipv4
  1. the first app is a laravel app, which will be access through it runs on LAMP. i can make this things work just fine, when i open the browser shows the correct app.

  2. the 2nd app is a vue js app, which will be access through i create a nginx server block and using this config to guide the to the folder containing the 2nd app. At the path /etc/nginx/sites-available/app2 i have nginx config as follow :

server {
        listen 80;
        listen [::]:80;
        root /var/www/app2;
        location / {
                proxy_pass http://localhost:8080;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;

The problem is, whenever i open the browser keep showing the first app.


Submit an 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.

Hi @legihendra7,

You’ll need to create a separate Nginx configuration file for your subdomain not use the same config.

Additionally, I can see you have proxy_pass http://localhost:8080; in your config which means you are parsing it to Apache, correct? Have you created the vhost configuration there as well or are you gonna use nodejs for your Vue App?

Regards, KFSys