July 14, 2021 . 2 MIN READ
nginx: [emerg] “XXX” directive is duplicate in /etc/nginx/conf.d/XXX.conf:7
Ask Question
Asked 2 years, 10 months ago
Active 20 days ago
Viewed 5k times
4
when doing
nginx -t
error message :
nginx: [emerg] “client_max_body_size” directive is duplicate in /etc/nginx/conf.d/proxy-settings.conf:7
nginx
Share
Improve this question
Follow
edited Aug 6 ’18 at 14:14
Barry
3,13477 gold badges2020 silver badges4040 bronze badges
asked Aug 6 ’18 at 14:07
Durga Prasad
7111 silver badge99 bronze badges
Add a comment
2 Answers
ActiveOldestVotes
3
Remove the second copy of the directive from file /etc/nginx/conf.d/proxy-settings.conf – at line 7.
Share
Improve this answer
Follow
answered Aug 6 ’18 at 15:05
IVO GELOV
8,52011 gold badge99 silver badges1616 bronze badges
Add a comment
0
actually i also defined “client_max_body_size” in /etc/nginx/sites-enabled/XXX.config, so the same variable “client_max_body_size” is duplicated in /etc/nginx/conf.d/proxy-settings.conf – that is the reason it is giving that error.
I resolved by removing the duplicate variable in /etc/nginx/conf.d/proxy-settings.conf :