P
P
postya2020-11-03 03:30:19
Nginx
postya, 2020-11-03 03:30:19

How to connect a domain to a website on a VPS?

I have a VPS where I host my projects (sites, applications)
VPS from Timeweb
In nginx/sites available I place files for each project separately
. There is also a folder with all webapps projects, which is located in the user's home directory /home/username/webapps

Created a config file for the trail-notes.tk site in the sites-available directory - trail-notes.conf

Created a free domain on freenom trail-notes.tk Created a
domain 3 days ago

Connected the domain to ns timeweb servers
on freenom Added this domain to timeweb

The site is not working
The site is written in VUE JS
The site is working, since I tried to prescribe the domain name ipaddress:port, the site was displayed, but it does not work with the domain name.
What could be the matter? How to properly connect a domain to nginx?

Timeweb:
5fa0a2931fcf5325783291.jpeg

Freenom:
5fa0a31054f1b055151747.jpeg

domain is being pinged
5fa0a342b3b20745638186.jpeg

5fa0a37aeeaa8734774775.jpeg

nginx config:

server {

    listen 80;

    server_name trail-notes.tk www.trail-notes.tk;

    charset utf-8;

    root    /home/kentforth/webapps/Trail-Notes/dist;

    index   index.html index.htm;

    # Always serve index.html for any request

    location / {

        try_files $uri /index.html;

    }

    error_log  /var/log/nginx/trail-notes-error.log;

    access_log /var/log/nginx/trail-notes-access.log;

}


dist directory:
5fa0a44f22880469448389.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-11-03
@postya

Congratulations - everything works!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question