Author Topic: How to add add_header Access-Control on conf generation file.  (Read 139 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Hi to all, I have an problem on one website where ttf file is blocked by CORS policy

The error is follow:  No 'Access-Control-Allow-Origin' header is present on the requested resource.


I have solved it adding this line
Code: [Select]
add_header Access-Control-Allow-Origin *; into the vhost conf gfile of related domain


Now I want to know how I can set it into nginx or cwp conf file?

I want this line of code to be inserted automatically every time a vhost.conf file is regenerated


Anyone can tell me where add this line of code?

Offline
****
Re: How to add add_header Access-Control on conf generation file.
« Reply #1 on: May 29, 2024, 09:18:46 PM »
WebServer Settings > WebServers Domain Conf
Add/Edit configuration
Note the nginx default vhost template. You would add it to whichever template you are using (such as force-https-http2).