DirectAdmin how to add custom http nginx proxy

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:
  1. location /
  2. {
  3. # access_log off;
  4. proxy_buffering off;
  5. proxy_pass http://mypublic_ip:8080;
  6. proxy_set_header X-Client-IP $remote_addr;
  7. proxy_set_header X-Accel-Internal /nginx_static_files;
  8. proxy_set_header Host $host;
  9. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  10. proxy_hide_header Upgrade;
  11. }

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.
 
Back
Top