nginxamazon-ec2http-postamazon-linux-2

403 forbidden on POST request nginx + amazon linux 2


I have setup a server on AWS everything working fine, i am able to fetch data from server but unable to POST, POST data is continuously giving 403 forbidden response,

i have check nginx logs, call never even reach there, but GET request are shows up on access.log.

error.log are empty and nothing happening there.

server {
    listen 80;
    listen [::]:80 default_server;
    server_name example.com www.example.com;
    location / {
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header Host $http_host;
            proxy_pass "http://127.0.0.1:3004";
    }
}

and yes there is a Load Balancer which is running on 443 port and forward to port 80 on the instance.


Solution

  • I get it after looking all the way arounds, there was a rule defined on Load Balancer, post call methoud be defined in lower case like post not POST.