413 error with Kubernetes and Nginx ingress controller

You can use the annotation nginx.ingress.kubernetes.io/proxy-body-size to set the max-body-size option right in your Ingress object instead of changing a base ConfigMap. Here is the example of usage: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: my-app annotations: nginx.ingress.kubernetes.io/proxy-body-size: “50m” …

nginx add headers when returning 400 codes

For nginx >= 1.7.5 Append “always” to the header definition: add_header ‘Access-Control-Allow-Origin’ ‘*’ always; For nginx < 1.7.5 According to the nginx official document of ngx_header_module, the add_header can’t work when response code is 400 syntax: add_header name value; default: — context: http, server, location, if in location Adds the specified field to a response … Read more

React Router BrowserRouter leads to “404 Not Found – nginx ” error when going to subpage directly without through a home-page click

The problem is that nginx doesn’t know what to do with /signin. You need to change your nginx config (usually in /etc/nginx/conf.d/) to serve your index.html regardless of the route. Here is a sample nginx config that might help: server { listen 80 default_server; server_name /var/www/example.com; root /var/www/example.com; index index.html index.htm; location ~* \.(?:manifest|appcache|html?|xml|json)$ { … Read more