Hello,
information about my files directory;
/etc/nginx /etc/nginx/conf.d /opt/forum/nodebb -----> where i’ve installed my nodebb
I would like to redirect my droplet ip and port to my subdomain.
I’ve managed to do sub.mydomain.com:4567 but i don’t want to let users see specific port.
i’ve successfuly installed nginx but i am having a trouble to set things right in conf file.
I did follow this guide to install nodebb on centos. https://www.rosehosting.com/blog/how-to-install-nodebb-on-a-centos-7-vps/
while i am on putty terminal, when i type **vi /etc/nginx/conf.d/yourdomain.com.conf **command, it gives me a blank page ( sort of ) ( not new window or something ) and i am adding this line as instructed
server {
listen 80;
server_name yourdomain.com; // i did change to sub.mydomain.com;
location / {
proxy_pass http://localhost:4567/; // i didn't change anything here
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
after i added these lines, i don’t know how to save while i am on putty so i am closing putty and it asks to me that " are you sure to close this session" so, i am saying “yes” and reopen putty to making further progress.
when i check the conf file i’ve created via filezilla, it is compiled so i can’t see if it is set as it should be or not.
I mean i can’t see this lines on file.
So Am i doing something wrong on putty ? Is there command or something that file i added those lines and save it while i am on putty without closing putty and see how it went ?
If it is not related with putty, how can i fix this ?
nodebb\config.json has set to;
{
"url": "http://sub.mydomain.net",
"secret": "secret thingy",
"database": "redis",
"redis": {
"host": "127.0.0.1",
"port": "6379",
"password": "password",
"database": "0"
},
"type": "literal"
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
@kamaln7
Thanks for your reply and your time.!
I did run sudo tail -n 50 /var/log/nginx/error.log this command and i got this;
I have no error.log file on /opt/nodebb ( where i’ve installed )
I did some search on google and it seems nginx related but im not sure how to solve to this and which file edit to solve.
if you just run
nginx -t
on its own it should give you any errors and what files if the existIt’s possible that the file isn’t being saved when you close PuTTy. By doing so you are terminating the SSH session and forcing
vim
(the text editor) to quit. Once you runsudo vi /etc/nginx/conf.d/yourdomain.com.conf
, pressi
and then paste in the nginx config. Then, press Escape then:
. Typewq
and press Enter. This will save the file and exit vim.You might prefer to use a different editor such as nano which is a bit easier to use.
sudo nano /etc/nginx/conf.d/yourdomain.com.conf
, paste your config file, and pressctrl
-x
to save. Follow the prompt the bottom.Make sure you restart nginx after adding the config file. That should be it.