How to reload my nginx server through cron or through node.js script instead of login from shell? - node.js

Previously I was using Apache server where redirect URL was getting created dynamically.
How to implement that in nginx server? I mean I have to restart/reload the nginx server again to implement that.
How to overcome my problem? How do I reload my nginx server through cron or through Node.js script instead of login from shell?
How to make it dynamic?

Related

How to launch Vite-React-App with Nodejs and Apache on Ubuntu?

How to launch Vite-React-App with Nodejs and Apache on Ubuntu?
The thing I ended is just a nodejs apache reverse proxy.
But how you bring in all the frontend stuff from react?

easiest way to host your node ftp server

I have been using heroku for my node js servers. This time I created an ftp server using ftp-srv npm package. However I have no idea how to host it. If I try to deploy it to heroku again, it provides me with an https url. I need to use ftp protocol, so need a url with ftp://. What could I do to deploy my server?

setting up nodejs on sharing host

how setting up nodejs on sharing host?
nodejs and git installed on my host and I access to ssh , but when I want to run my application , apache handle those routes.
I read some article but those said fix with httpd.conf and I don't access to httpd.conf
If you have the proper permissions you can forward all the traffic from port 80 that apache handles to the port that your node app is running. You can find examples on google if you search for keywords like apache, vhosts and reverse proxy.

Redirect a url to a local server

Is there any way to redirect a url to a local server?
Like http://example.com/1.js to http://localhost/1.js, without changing hosts file, using node js.
To configure apache on windows, refer this link proxy on windows
To configure apache on UBUNTU, refer this links
Apache2 reverse proxies
Apache proxy on ubuntu
In below code,
if i visit localhost/http-bind. it will hit localhost:5280/http-bind/
ProxyPass /http-bind http://localhost:5280/http-bind/

403 Forbidden after successfully installing Ghost

I have been spending days figuring out how to install the viral Ghost platform, and experienced numerous errors. Luckily, I have managed to install it - Ghost gives me a positive Ghost is running... message in SSH after I've done npm start --production. However, when I browse to my website - http://nick-s.se - Apache displays its default page and when I go to the ghost login area - /ghost, the site returns a 403 Forbidden.
P.S. I have specifically installed Ghost on a different port than the one Apache is running on. I don't know what's going on...
Update - I have found out that I can access my Ghost installation by adding the port number 2368 which I've configured in the config.js. Now, however my problem is - how can I run Ghost without using such ports?...
tell your browser you want to connect to the port Ghost is running on: http://nick-s.se:2368
So a few things, based on visiting:
1) It seems Apache isn't proxying the request onward to Ghost. Are you sure that you've configured it properly?
2) It also looks like Apache doesn't have access to the directory that you set as root. This shouldn't be necessary anyway if proxying is set up correctly, but could become an issue later if you wanted to use apache to serve things like the static assets.
If you are open to nginx instead of Apache, I have written a how to on this: link. You can skip the section on configuring Nginx. Otherwise, still might be useful if you figure out the conversion of rules from Nginx to Apache.
If you don't have any other sites running on your VPS you can just turn apache off and not have to deal with apache proxying the request to port 2368 and have Ghost run on port 80. If your VPS is running CentOS you can check out this how to on disabling apache and running Ghost on port 80.

Resources