Help needed on Nginx plus configuration

Akhil Dangore akhil.dangore at calsoftinc.com
Tue Feb 6 12:21:44 UTC 2018


Hello Team,

I am trying Nginx plus for our company product, Currently I am using 
trail account to achieve our requirement but I am facing some issue.

Details explanation of issue:

  * I have configured Nginx plus with attatched file, Here I have
    enabled nginx API to reconfigure nginx plus run time
  * I am facing some issue to configure using nginx API, below are some
    examples of requests:
      o curl localhost:80/api/2/http/requests
          + {"total":111562,"current":1} - Working fine
      o curl localhost:80/api/2/http/upstreams
          + {} - empty dict - Not working fine, since I have configured
            upstreams in nginx.config file as below:
          +          upstream backend {
                         server localhost:8080;
                         server localhost:8090;

                     }
                     location / {
                         proxy_pass http://backend;
                     }
          + Why am i receiving empty dict ?

If you need more details, please let me know.

Regards,
Akhil



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180206/6a2b9821/attachment.html>
-------------- next part --------------

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}



http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    upstream backend {
        server localhost:8080;
        server localhost:8090;

    }

    server {
        listen 80;
	server_name localhost;
       
        location /nginx_status {
		# Enable Nginx stats
		stub_status on;
		allow all;
	}

        location /api {
             api write=on;
             allow all;
        }	

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

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}


# TCP/UDP proxy and load balancing block
#
#stream {
    # Example configuration for TCP load balancing

 #   upstream stream_backend {
 #       zone tcp_servers 64k;
 #       server backend1.example.com:12345;
 #       server backend2.example.com:12345;
#    }

 #   server {
 #       listen 12345;
 #       status_zone tcp_server;
 #       proxy_pass stream_backend;
 #   }
#}


More information about the nginx mailing list