jeudi 28 octobre 2021

Spring boot Post calls are not working with NGINX

I am running Spring boot application on port 9077.All API calls(GET,POST..) are working fine when I use the IP address.But only get calls are working when I use the domain name. This is my nginx config:

server {        
listen 80;        
listen [::]:80;  
server_name example.com;    

location / {             
       proxy_pass http://localhost:9077/; 
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection 'upgrade';
       proxy_set_header Host $host;   
       proxy_cache_bypass $http_upgrade;  
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Forwarded-Port $server_port;
      } 

 error_page  404     =200 $uri;
}



Aucun commentaire:

Enregistrer un commentaire