0

Need help/suggestion on setting up an web application and REST api in server.

Currently there are 3 applications like as below

  1. User web application - Running on node.js - port 3389 / universal react application
  2. Admin web application - Running on apache - port 8080 / laravel
  3. Rest Api for user application - Running on apache - port 8080 / laravel

Currently we load the applications like as below

User Application:- www.xyz.com:3389 www. xyz .com:3389/help www. xyz .com:3389/landlord-intro

Admin Application:- www.xyz.com/app/admin

REST Api routes:- GET http://xyz/app/country?id=1 GET http://xyz/app/location

For loading the user application without port number , we tried to set proxy pass in apach conf like as below

ProxyPass http://127.0.0.1:3389/ ProxyPassReverse http://127.0.0.1:3389/

ProxyPass http://127.0.0.1:8080/app/admin/ ProxyPassReverse http://127.0.0.1:8080/app/admin/

Now the after restarting the apache , we are able to access user application without using port number but unable to access the admin application and also we need to know how to proxy pass rest API's from client.

1 Answer 1

0

You can use or create virtual host ,In Apache HTTPD basically it would be like this:

<VirtualHost *:80>
ServerName xyz.com
Redirect / https://example.com/
</VirtualHost>

<VirtualHost *:443>
ServerName example.com
SSLEngine on
SSLCertificateFile /path/to/cert.pem
SSLCertificateKeyFile /path/to/key.pem
ErrorLog /path/to/logs/publicaname.example.com-ssl-error.log
CustomLog /path/to/logs/publicaname.example.com-ssl.log combined

ProxyPass /api/input http://127.0.0.1:8080/api/input
ProxyPassReverse /api/input http://127.0.0.1:8080/api/input
</VirtualHost>
Sign up to request clarification or add additional context in comments.

2 Comments

That we have done,it's mentioned in the post as well. One user application works but the other does not.
' <Location / > ProxyPass 127.0.0.1:3389 ProxyPassReverse 127.0.0.1:3389 </Location> <Location /app/admin > ProxyPass 127.0.0.1:8080/app/admin ProxyPassReverse 127.0.0.1:8080/app/admin </Location>' This did not work. The user app opens fine which is www.xyz.com:3389 but the admin app: www.xyz.com/app/admin does not up

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.