HI I put below codes in the nginx Directives setting, and clicked save. after ispconfig finished applying the changes, I open the nginx Directives setting again, and see the below codes there. but open the vhost file of that website, the codes are not there. more_set_headers 'Access-Control-Allow-Origin: *'; more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS'; more_set_headers 'Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; if manually put the codes into vhost, it works. but ispconfig will remove the codes after saving changes.
Rename the .vhost file to vhost.bak, then rename the vhost.err file to .vhost, restart nginx and check the log to see why nginx fails to start.
No, you misunderstood my question. Nginx is running fine. the issue here is ISPconfig can not save the code below I saved in nginx Directives. the vhost file has no that codes after saved. more_set_headers 'Access-Control-Allow-Origin: *'; more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS'; more_set_headers 'Access-Control-Allow-Headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
So you are not interested to find out why ISPConfig is not saving the changes? But why do you post here then if you do not want to know why changes are not saved?
I don't know why, but I put the codes into nginx.conf http section to make it working instead. thanks
Is there a file in the vhost file directory with name ending in ".err"? If there is, ISPConfig renamed the vhost file to that, so you do not see the changes you made in the vhost file. @till suggested a way to find out why nginx did not start with the changes, making ISPConfig do the renaming to make nginx start.
The err file is in the sites-available, not in sites-enabled, just in case you did not check both directories. You can also use debug mode for further details: https://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/