I am currently trying to run a Node server on a Raspberry Pi. Full disclosure: I have no knowledge of servers, I am an interface designer and developer, so command lines are an unknown to me, don't expect prior knowledge.
I tried to follow many instructions on installing Nginx, but now it fails and I can't it to point to a line where I could check where it fails.
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
The journalctl -xn says there is no file, and the other one gives me details, but I cant make heads or tails of it:
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Fri 2017-07-07 12:43:36 EDT; 38s ago
Process: 1071 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
I followed an instruction where it said that it's best to copy the sites-available/default rather than edit it, and here is what I did:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/osc-api/www;
index index.html;
server_name _;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name osc-api;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000/;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
And yes, it is symlinked to the sites-enabled. I guess I am looking for info on how to understand how to fix this issue.
server {}block. Does that sound good enough to you?