feerdispzoo
Verified User
- Joined
- Jan 17, 2022
- Messages
- 189
How to add custom nginx configuration directly in DirectAdmin ?
I access: http://....../admin/custom-httpd/domain/domain.pl/nginx_proxy
Example original:
I want to modify proxy_pass and remove some unwanted headers due to conflix with app. So i try paste:
After save:
nginx: [emerg] duplicate location "/" in /usr/local/directadmin/data/users/node/nginx.conf:34
nginx: configuration file /etc/nginx/nginx.conf test failed
I try also add custom in custom2 field, but this add only line above #access_log off and not remove unwanted headers.
I access: http://....../admin/custom-httpd/domain/domain.pl/nginx_proxy
Example original:
- location /
- {
- # access_log off;
- proxy_buffering off;
- proxy_pass http://mypublic_ip:8080;
- proxy_set_header X-Client-IP $remote_addr;
- proxy_set_header X-Accel-Internal /nginx_static_files;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_hide_header Upgrade;
- }
I want to modify proxy_pass and remove some unwanted headers due to conflix with app. So i try paste:
- location /
- {
- # access_log off;
- proxy_buffering off;
- proxy_pass http://mypublic_ip:9000;
- }
After save:
nginx: [emerg] duplicate location "/" in /usr/local/directadmin/data/users/node/nginx.conf:34
nginx: configuration file /etc/nginx/nginx.conf test failed
I try also add custom in custom2 field, but this add only line above #access_log off and not remove unwanted headers.