![Nextcloud 12에서 X-Frame-Options 문제가 발생했습니다.](https://linux55.com/image/123682/Nextcloud%2012%EC%97%90%EC%84%9C%20X-Frame-Options%20%EB%AC%B8%EC%A0%9C%EA%B0%80%20%EB%B0%9C%EC%83%9D%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
Apache를 사용하여 Centos 7에 Nextcloud 12를 새로 설치합니다. 아직 아무것도 구성하지 않았지만 관리 콘솔에 다음 오류 코드가 계속 표시됩니다.
X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN
X-Content-Type-Options" HTTP header is not configured to equal to "nosniff
.htaccess 파일을 살펴보았는데 둘 다 설정되어 있지만 Apache를 다시 시작해도 오류가 지속됩니다.
<IfModule mod_env.c>
# Add security and privacy related headers
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set X-Robots-Tag "none"
Header set X-Download-Options "noopen"
Header set X-Permitted-Cross-Domain-Policies "none"
SetEnv modHeadersAvailable true
</IfModule>
답변1
안녕하세요, 아파치가 .htaccess 파일을 읽지 못하는 것 같습니다. 이는 일반적으로 다음 방법으로 해결할 수 있습니다.
sudo nano /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"
After the section ends<Directory "/var/www/html"> </Directory>
<Directory /var/www/html/nextcloud>
AllowOverride ALL
Require all granted
</Directory>