Reputation: 8420
I got this code while executing nginx
:
nginx: [emerg] unknown directive "serversupstream" in C:\nginx-1.17.9/conf/nginx.conf:15
This is my nginx.conf:
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
# List of application
serversupstream portal_server {
server 127.0.0.1:9510;
}
upstream portal_web_server {
server 127.0.0.1:8085;
}
server {
listen 8001;
server_name localhost;
location /api {
proxy_pass <http://portal_server;>
proxy_http_version 1.1;
proxy_redirect off;
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;
}
location /dte {
proxy_pass <http://portal_web_server;>
proxy_http_version 1.1;
proxy_redirect off;
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;
}
location /simulacion {
proxy_pass <http://portal_web_server;>
proxy_http_version 1.1;
proxy_redirect off;
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;
}
}
include servers/*;
}
I don't know that error message, what it is?
EDIT:
According to http://nginx.org/en/docs/dirindex.htm there is no serversupstream
I don't understand, I'm just using a nginx.conf that many other guys in the team are using, but they are on mac and/or linux, I'm the only one in Windows.
So, I change serversupstream
to upstream
and there it triggers another error, it's complaining about the prefix for:
proxy_pass <http://portal_web_server;>
So I change removed those <>
and there I tried again, now nginx doesn't show anything in the console... just this:
Upvotes: 0
Views: 608
Reputation: 428
change encoding of the configfile to Utf8. Don't use built'in Notepad.exe to Save as to Uft8, it will save as Utf8 BOM. Use Notepad++ or other editor.
Upvotes: 1