Unable to redirect the URL to another page in docker app - node.js

Summarize of my problem:
I have create a website using MERN stack and deployed to AWS using docker.
when I refresh the domain page i.e http://discussion.sramanujan.com/ ,it works fine.
When I directly try to access the discussion url http://discussion.sramanujan.com/discussion , I get "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"
Steps to repro the issue:
lauch the website http://discussion.sramanujan.com/
Refresh the browser [website should reload successfully]
Click on discussion button. [website url will change to http://discussion.sramanujan.com/discussion ]
Refresh the page.
Expected:
Page should load discussion page on refresh
Actual:
Got an error message as "Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
Any idea as how to handle this issue?
More information:
1.host server port 80 is mapped to docker container port 3000.
2.Navigation through website is working fine.
/usr/src/api is my WORKDIR
Logs from server:(on refresh I get error 500)

you are also getting a 304 (Not modified) error on your website, try to enable javaScript, after that it should work

Related

How to find out why I get 500 error from Firebase on server but not on localhost

I try to run my first node application on my server from subdomain. It works perfectly on my PC but when I move it to the server, seems everything works, site loads with all js except Firebase.
I get the following errors in chrome:
/firebase/firestore net::ERR_ABORTED 500 (Internal Server Error)
/firebase/app net::ERR_ABORTED 500 (Internal Server Error)
The 2 lines of my my .js triggers the error:
import firebase from '/firebase/app';
import '/firebase/firestore';
Obviously it can mean millions different issues but I have no idea how to find any logs or anything what would tell me why this error triggered.
I tried to turn off/on https. I checked logs on server but found nothing just the same 500 error in access log. I tried but couldn't find any node specific log on the server. I tried to re-install firebase. After I tried to re-install node and everything and re-started from scratch.
I tried to copy the whole node_modules folder to the server from my PC but didn't help.
I would expect it to run just as on localhost or at least see some log about the error so I could fix it. The server is Linux VPS with plesk obsidian. The app is on a subdomain, the main domain has php website running.

Cant connect azureweb app to node server, resulting in net::ERR_CONNECTION_REFUSED

I am using node.js and react and have deployed to the azure app service,
the startup command is pm2 serve /home/site/wwwroot --no-daemon --spa which works
However when I visit the website and visit a page that needs to load images from a database or perform any http requests, the app can't connect to the node.js server and I get the error:
https://boobah.azurewebsites.net:8080/requests/therapists net::ERR_CONNECTION_TIMED_OUT
The call I make in my code to load the data to the page is this:
await axios.get('https://boobah.azurewebsites.net:8080/requests/therapists')
which works locally just by changing the domain to localhost and on port 3000.
Can anyone please help me for why this is not loading any data to the deployed azure app ?
Thanks you

I can't execute a website using blazor webassembly published on IIS

I created a project with Blazor Webassembly using SignalR (VS 2019 - .Net Core 3.1).
When I run it from the development environment it works correctly, but when I publish it to IIS (the server project) and I try to run it, it shows me the following message:
Loading...
An unhandled error has occurred. Reload 🗙
The messages in the console are:
Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)
blazor.webassembly.js:1
Failed to load resource: the server responded with a status of 404 (Not Found)
app.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.min.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)
app.css:1
I was having the same issue and the same resolution resolved it for me!
What I did was browse to the website where I hosted it, went into developer mode of the browser (F12), hovered over the error and looked at the path!
In my index.html file I had in the and just needed to remove the forward slash and it started working just fine!

Cannot read property 'NODE_ENV' of undefined in nodejs on https SSL

I have install the ssl certificate in my angular and nodejs project. but after installing the certificate i am unable to login into my application. My main index.js file is running perfectly, but when i am tried to login from my application, it showingn me 500 (Internal Server Error) with a message (Cannot read property 'NODE_ENV' of undefined). I am showing you the localhost but the same problem is coming on production.Please help me out here, how can i fix it.
My error image of application
My nodejs console working picture
It's not HTTPS SSL problem.
Seems that the problem is on the file which defines a handler for POST /login, attach this file for more details.

Angular 2 Routing with Amazon EC2 404 error

I am trying to get a deployment of a MEAN stack app using angular2 v1.0.0 beta.3 up and running. Everything is going well so far except this annoying routing issue that did NOT occur when I deployed to Heroku. However; this is my first experience deploying to ec2 using elastic beanstalk.
When I open up the route at the base route / the page loads as normal and I can use the app as if nothing is wrong. However, if I navigate to a subroute, in my case /client/issue/:id , the state loads, but if I reload the page I will get a 404 ERROR. In my server.js I have what I thought was a 404 catch app.get('*', loadIndex'), but this does not seem to be the case. I assume it is an issue with the way ec2 handles routing, but I am not sure.
EDIT
It might also be worth noting that I am only getting an error in my /var/log/nginx/error.log file and not the /var/log/nodejs/nodejs.log file.
From the error.log file:
2016/04/06 15:14:00 [error] 18952#0: *16 open() "/var/app/current/client/Issue/yes/57044092fe1924e77d9049ab" failed (2: No such file or directory), client: 172.31.4.202, server: , request: "GET /client/Issue/yes/57044092fe1924e77d9049ab HTTP/1.1",

Resources