I
I
Ismail2020-04-29 02:34:55
Nginx
Ismail, 2020-04-29 02:34:55

Nginx invalid parameter in upstream?

I want to set up nginx for my vps. You need to do a redirect so that you do not need to enter the port in the url. When setting the address, I get an error:

invalid parameter "xxx.xxx.xxx.xxx:8080" in /etc/nginx/conf.d/default.conf:2


Here is the default.conf :
default.conf

upstream backend_upstream {
  server xxx.xxx.xxx.xxx:8080; //Скрыл ip port :)
}

server {
  listen 80;
  server_name _ samplename;

  root /app/dist;

  proxy_set_header Host $http_host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  location ~ (.*\.js\.map|.*.css.map) {
    return 404;
  }

  location / {
    add_header Cache-Control "no-cache";
    try_files $uri /index.html;
  }

  location @backend {
    proxy_pass http://backend_upstream;
  }

  location /api {
    try_files $uri @backend;
  }

  location /images/ {
    root /app/public;
  }

  location /rails {
    proxy_pass http://backend_upstream;
  }
}



How to set IP address of vps server for forwarding?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hellfleet, 2020-04-29
@hellfleet

server xxx.xxx.xxx.xxx:8080; //Hid the ip port :)

comments in nginx only start with #

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question