Issue
I have vps server in Ubuntu 18.04. my backend project is Laravel so frontend is Nuxt. I want deploy my laravel project as subdomain in 80 port. example : api.domain.com. Frontend project deploy in 3000 port as main domain. example domain.com. How I configure my apache for subdomain and how redirect main domain 3000 port?
Solution
You can configure your Apache to proxy port 80 -> 3000.
<VirtualHost *:80>
ServerName api.domain.com
DocumentRoot "/your/laravel/application/path/public"
</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName domain.com
ServerAlias domain.com
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
Once you're done with configuring Apache, you'll have to enable the required Apache modules and restart.
sudo a2enmod proxy && sudo a2enmod proxy_http && sudo service apache2 restart
[Derived from this answer.]
As for your Laravel application, I'm going to assume you've installed PHP and loaded the Apache PHP module.
Answered By - sykez