Question

how to config rest service with parameter in nginx

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 problem.here is the config file for REST

events {}
http {
   default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
      charset utf-8;
    upstream backendserver {
    
        
        server 112.000.0.111:8000  backup;
        server 11.000.3.112:8000 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/ 
Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @alyamobeen,

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

        server 112.000.0.111:8000  backup;
        server 11.000.3.112:8000 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.