how to config rest service with parameter in nginx

Posted October 11, 2021 83 views

I am configuring rest and soap services in nginx. Soap service is working fine but for rest srvices its giving error 404 not found.In rest service I have parameter which is the is the config file for REST

events {}
http {
   default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
      charset utf-8;
    upstream backendserver {

        server  backup;
        server max_fails=3 fail_timeout=180s ;

        keepalive 64;
    server {
    listen 8000;
    include api_conf.d/*.conf;

  location/services/ert/api/potentialvalue(.*)$ {
  limit_except GET {
                 deny all;
       proxy_pass http://backendserver/ 
edited by KFSys

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @alyamobeen,

First I see there are two servers added in the backend upstream :

        server  backup;
        server max_fails=3 fail_timeout=180s ;

Are you sure these IPs are correct and you have access to them?

As for the parameter you’ve mentioned are you by any chances talking about : location/services/ert/api/potentialvalue(.*)? I think using it like that location/services/ert/api/potentialvalue$ should be enough.

  • yes APIs are correct and I do have access. but I can’t access the service. the url is /services/ert/api/parameter?arg=value
    any guess how it can work