- Server operating system version
- Ubuntu 22.04.4
- Plesk version and microupdate number
- 18.0.63.3
I've recently migrated a domain from an old Plesk Host to a newer one, the old Plesk did not use nginx at all.
After migration to the new host, I noticed breakage on the site because headers that were supposed to be set server-side via .htaccess were not present anymore.
.htaccess sets the header:
I did not touch any hosting settings for the domain after migration, it was still set to:
PHP Handler: 8.3.0, Dedicated FPM application (Apache)
Hosting -> Apache & Nginx -> Proxy mode [enabled]
(everything else on this settings page is not enabled, except for additional HTTP/S directives that the Plesk Migration wizard copied over)
From my understanding, this should result in Apache being used to process the request (after being proxied through nginx), hence .htaccess should continue to work?
But apparently, the Access-Control-Allow-Origin/Methods headers were missing on URIs which previously had them...
Why are the headers missing? Is the nginx proxy stripping those from the response?
BTW I fixed it through additional nginx directives, but I need to know why the .htaccess directives are not working anymore, and how to re-enable them so I can migrate all other domains from the old Plesk host without further mishaps.
Thanks guys.
After migration to the new host, I noticed breakage on the site because headers that were supposed to be set server-side via .htaccess were not present anymore.
.htaccess sets the header:
Apache config:
<FilesMatch "\.(jpeg|jpg|png|svg|pdf|mp4|gif)$">
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods: "GET"
</FilesMatch>
I did not touch any hosting settings for the domain after migration, it was still set to:
PHP Handler: 8.3.0, Dedicated FPM application (Apache)
Hosting -> Apache & Nginx -> Proxy mode [enabled]
(everything else on this settings page is not enabled, except for additional HTTP/S directives that the Plesk Migration wizard copied over)
From my understanding, this should result in Apache being used to process the request (after being proxied through nginx), hence .htaccess should continue to work?
But apparently, the Access-Control-Allow-Origin/Methods headers were missing on URIs which previously had them...
Why are the headers missing? Is the nginx proxy stripping those from the response?
BTW I fixed it through additional nginx directives, but I need to know why the .htaccess directives are not working anymore, and how to re-enable them so I can migrate all other domains from the old Plesk host without further mishaps.
Thanks guys.