Use same domain for front and backend Net core Angular application
£10-20 GBP
Closed
Posted over 3 years ago
£10-20 GBP
Paid on delivery
Hello there I have 2 application hosted on the server. 1 angular running with node.js on port 4000 and one net core running trough the kestrel on port 5000. The angular application falls back to [login to view URL] I can curl on the server localhost:4000 and get back data The net core application falls back to not found but I can curl on the server localhost:5000/weatherforecast and get back data. Both application have no error in logs. I have 2 virtual hosts for port 80 that are proxying respectively one 4000 port and one 5000 port
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / [login to view URL]
ProxyPassReverse / [login to view URL]
ServerName [login to view URL]
ServerAlias [login to view URL]
ErrorLog /var/log/apache2/[login to view URL]
CustomLog /var/log/apache2/[login to view URL] common
RewriteEngine On
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_NAME} =[login to view URL] [OR]
RewriteCond %{SERVER_NAME} =[login to view URL]
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / [login to view URL]
ProxyPassReverse / [login to view URL]
ServerName [login to view URL]
ServerAlias [login to view URL]
ErrorLog /var/log/apache2/[login to view URL]
CustomLog /var/log/apache2/[login to view URL] common
RewriteEngine On
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_NAME} =[login to view URL] [OR]
RewriteCond %{SERVER_NAME} =[login to view URL]
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
and 2 virtual host for port 443
<IfModule mod_ssl.c>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass / [login to view URL]
ProxyPassReverse / [login to view URL]
ServerName [login to view URL]
ServerAlias [login to view URL]
ErrorLog /var/log/apache2/[login to view URL]
CustomLog /var/log/apache2/[login to view URL] common
RewriteEngine On
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Include /etc/letsencrypt/[login to view URL]
SSLCertificateFile /etc/letsencrypt/live/[login to view URL]
SSLCertificateKeyFile /etc/letsencrypt/live/[login to view URL]
</VirtualHost>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass / [login to view URL]
ProxyPassReverse / [login to view URL]
ServerName [login to view URL]
ServerAlias [login to view URL]
ErrorLog /var/log/apache2/[login to view URL]
CustomLog /var/log/apache2/[login to view URL] common
RewriteEngine On
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Include /etc/letsencrypt/[login to view URL]
SSLCertificateFile /etc/letsencrypt/live/[login to view URL]
SSLCertificateKeyFile /etc/letsencrypt/live/[login to view URL]
</VirtualHost>
</IfModule>
however will display only the application on the first virtual host for port 443 the above file in this case 4000 but not both. I can make work one or the other but not togheter. They both work on http curl I am guessing something wrong to this last file virtual host
I pay 10 pound if you help me get site up and running with backend and frontend
I have over twenty years being a one man IT shop, I have twenty years of apache server experience and almost ten years with angular JS, two with angular.
ok not sure if your app is PWA if it is you might also be a config change there, I can fix the server issue only for this price and will take me less than an hour with SSH access.
Hi,
Greetings of the day,
I've 11+ years of experience in IT Industry and worked in various technologies like Asp.Net/ MVC/CORE, Windows form, SQL server, Angular and ReactJs.
I can assure you the best quality work in timely manner.
Can we connect to discuss it further.?
Thanks,
Pramod