K
K
kFerst2019-10-12 18:12:14
cloudflare
kFerst, 2019-10-12 18:12:14

How to remove the 403 error when linking to an image on another site?

There are two sites (both mine):
1) api.example.com
2) app.example.com
I'm trying to upload images to app.example.com with the following path: api.example.com/res/images/...
( I'm also trying to do this on a local server).
I end up getting a 403 error when I try to upload an image. The logs are clean, which is strange for me.
How to solve this problem?

api.example.com/.htaccess
RewriteEngine On
   #  Директива включает редиректы.
RewriteBase /
   # Без директивы (.*) = /$1 будет /var/wwww/site/web/$1  с директивой  = /$1
Options +FollowSymLinks
   # Разрешает переход по символическим ссылкам.
php_flag display_errors off
  # запретить отображение ошибок  (требование монитора качества)
php_flag allow_url_fopen off
  # запретить  использовать удаленные файлы (требование проактивной защиты)

DirectoryIndex index.php

RewriteRule ^(.*)$ index.php



SetEnvIf Origin "http(s)?://(www\.)?(тут мои домены|и статические ip моего пк)$" AccessControlAllowOrigin=$0
        Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
        Header merge Vary Origin

PS Also, if it helps - the site is connected to CloudFlare, in the page rules I made it so that the content is not cached.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kFerst, 2019-10-12
@kFerst

Solution:
https://support.cloudflare.com/hc/en-us/articles/2...
We follow the link that was indicated in the article (at the very bottom)
cloudflare.com/a/content-protection/YOUR-DOMAIN .com.
Next, switch the slider to the inactive position.
5da1f3152bcac174356790.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question