My frontend is made on Vue.js and is running on nginx in production. My nginx.conf looks like:
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 100M;
# added for VueRouter
location / {
try_files $uri $uri/ /index.html;
}
}
In Node.js app I have this endpoint using multer to accept file:
// 100 MB
const upload = multer({ storage, limits: { fileSize: 100 * 1024 * 1024 } })
const router = express.Router()
router.post('/create', upload.single('file'), ImageController.create)
Also in app.js I have bodyParser set to 100 MB:
const app = express()
// Middleware
app.use(bodyParser.urlencoded({ limit: '100mb', extended: true, parameterLimit: 100000 }))
app.use(bodyParser.json({ limit: '100mb' }))
But I still get the error
413 Request Entity Too Large
Am I missing something?