Welcome! Log In Create A New Profile

Advanced

Help needed on Nginx plus configuration

Posted by Akhil Dangore 
Akhil Dangore
Help needed on Nginx plus configuration
February 06, 2018 01:30PM
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




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;
# }
#}
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Igor A. Ippolitov
Re: Help needed on Nginx plus configuration
February 06, 2018 02:00PM
Akhil,

As a trial user you can ask evaluations@nginx.com to help you with this
setup.
API queries data in status zones. You should configure one for your
upstream with 'zone backend 64k;' or similar statement inside upstream{}
block.

Regards.

On 06.02.2018 15:21, Akhil Dangore wrote:
>
> 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
>
>
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login