C
C
ceeed2021-09-28 17:02:42
Nginx
ceeed, 2021-09-28 17:02:42

When setting the front on the server, I get the following error: State: degraded, what should I do?

I understand that some 3 files cannot start or have not passed the test, or the error is in these 3 files. How to solve this problem? The task is to put the front on the server. Here are all my steps:

I do dist already on the server, before that I loaded all the modules.

Because I already have one version of the project running on a backend that is running on the server and this backend has a separate ip address and a separate port to which I can access directly from the application via localhost, I make another folder in the folder where I have the dist of another version and call it version2, in this folder I already insert the dist of my new version. Thus, the path to my new project is like this:

[email protected]:~/cryptoVer1.1/crypto/version2/dist$

Next, I create a file for nginx.
sudo nano /etc/nginx/sites-available/crypto-version2.conf

I add this code to the file, specifying my settings.
server { listen 59080;

server_name localhost;

root /home/user/cryptoVer1.1/crypto/version2/dist;

index index.html index.htm;

location / {
    try_files $uri $uri/ /index.html;
}

error_log /var/log/nginx/crypto-version2-error.log;
access_log /var/log/nginx/crypto-version2-access.log;
}

I activate the file and create a link for it to the sites-enabled directory.
sudo ln -s /etc/nginx/sites-available/crypto-version2.conf /etc/nginx/sites-enabled/crypto-version2.conf

I restart nginx I
sudo systemctl restart nginx
check the status of nginx.
sudo systemctl status
And here I get an error, how to fix it? What did I do wrong when setting up?
61531f587d609066760737.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2021-09-28
@karabanov

nginx -tallows you to test the config and shows where there are errors.

B
Boris Syomov, 2021-09-28
@kotomyava

If the status of nginx is checked, then it should be. systemctl status nginx
If this is not a typo, and you need to understand why the system as a whole has the degraded status, then you can see which units have failed: systemctl list-units --state failedand then look at the logs.
Perhaps it has nothing to do with your actions at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question