How can I implement the return of scripts and styles that are located, for example, on the example.com domain with files.example.com on the nginx server?
Nginx config example:
server { listen %ip%:%httpport%; listen %ip%:%httpsport% ssl; server_name %host% %aliases%; #if ($request_method !~* ^(GET|HEAD|POST)$ ){return 403;} location ~ /\. {deny all;} location / { proxy_buffer_size 64k; proxy_buffering on; proxy_buffers 4 64k; proxy_connect_timeout 5s; proxy_ignore_client_abort off; proxy_intercept_errors off; proxy_pass http://%ips%:%httpbackport%/; proxy_pass_header Server; proxy_read_timeout 5m; proxy_redirect off; proxy_send_timeout 5m; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $http_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|cur|swf)$ { root "%hostdir%"; expires 7d; } location ^~ /apacheicons/ { alias %sprogdir%/modules/http/%httpdriver%/icons/; } location ^~ /apacheerror/ { alias %sprogdir%/modules/http/%httpdriver%/error/; } }