Plesk NodeJS is showing 404 Page Not Found Error - node.js

I am running NodeJS on one of my subdomains on plesk panel.
I set the application directory and startup file correctly but when I open the subdomain url on my browser, I get a 404 error which says page not found.
In my logs, I see this error
.732 [INFO] [188.158.19.112:8597] Index file is not available in [/var/www/vhosts/domain.com/hello-world/public/]
It seems that it is looking for index file instead of running the NodeJS app.js file

Related

How can I fix IISNode internal server error? listen EACCESS permission denied

I added a node application as a website on IIS with a web config file and whenever I try to browse the website it gives this error:
Error on web browser.
I have tried using the taskkill command to stop the process listening to this port and I also tried giving IIS_IUSRS user full permission on the root folder, but this issue persists
web.config file:
config file image
So I was able to find my way around this issue. I removed the application from IIS and I used pm2 to start the node application and I didn't encounter any error after using this approach.

Getting 404 - File or directory not found when downloading a file

I have hosted a web API which written in laravel on the IIS server. There is one "versionUpgrate" API where the app asks the server to send the link to an apk file to download if there is any version is out.
"
But when I execute the below URL in the browser, I am getting "404 - File or directory not found". I am expecting the file should get downloaded here.
https://xxxx.xxxx/apk/beta_4_22_2.apk
Don't know what is blocking it here?
--------------EDIT --------------------
I believe laravel is not blocking it because this apk folder exists in the public folder. So URL is accessible.
You can try to add the type to IIS MIME Types.
Open IIS Manager
Selection "MIME Type" feature
Add...
type Extension ".apk" and MIME type "application/vnd.android.package-archive"
OK

wwwroot doesn't exist in inetpub

I installed IIS on my computer, but when I try to load localhost on google chrome it's says
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification Unknown
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\C:\inetpub\wwwroot\web.config
Requested URL http://localhost:80/
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
I also don't have wwwroot in my inetpub folder and I think that's why the error above appears. I created then my wwwroot folder in the ineptpub folder, but I have a new error: HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
What can I do in this situation?

Express JS not serving few static files, throws 500 internal server error

When express server is started with SPA application index file and few other static files are loaded and some files throw 500 error
NodeJS server is running, and serving the static files from the correct folder. (This can be confirmed as it loads index.html and some other assets)
As seen from the network tab scripts.2d2e0c1a64a29c086e01.js, jspdf.min.js, favicon are loaded from the same static folder, but other js files are not loaded.
When error files are opened with full link (localhost:3000/main-es2015.b21fb6bfbdb8538cc020.js) these files are also loaded aswell.
The static folder contains the build files from angular 8.
Same issue when tried with nginx reverse proxy config.
Any help is much appreciated. Thank you
I found that the new URL wasn't allowed in the Content Security Policy list, once adding it everything works as expected. Thank you.
I had a similar error -- HTTP 500 when requesting an image from Express -- and corrected it by granting more permission to the static files. When the error was happening, the image file had permissions -rw-rw----. I used sudo chmod 666 public/static/*.jpg to change this to -rw-rw-rw-, and the problem was solved.

Nodejs giving 404 error on hosting in cpanel?

I tried to run Nodejs app on cPanel. I saw YouTube tutorial and in YouTube everyone is running fine with hello world message, but when I apply same step( step as below), I get 404 error? where am I missing?
steps I followed
I went to cPanel and to Nodejs setup
I filled up empty spaces as below screenshots.
and when I click the link i am getting 404 error.
do I also need to add .htaccess file?
also I tried package.json file.

Resources