مرحباً،
أرغب في ضبط ترويسة ‘Referrer-Policy’ على ‘same-origin ’. لا يمكن القيام بذلك عبر nginx، لأنه يتم ضبطه عبر Redis/Rails.
الإعداد الافتراضي يبدو:
Referrer-Policy' => 'strict-origin-when-cross-origin'
هل من الممكن تغييره إلى:
Referrer-Policy' => 'same-origin'
لم أتمكن من العثور على السلسلة النصية داخل/خارج الحاوية.
نعم. غبي. لم أكن أبحث في المكان الصحيح.
وجدت العديد من الإدخالات لـ
Referrer-Policy' => 'strict-origin-when-cross-origin'
إليك قائمة (grep strict-origin-when-cross-origin /var/www/discourse/ -R):
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-protection-2.2.2/lib/rack/protection/referrer_policy.rb: # referrer_policy:: The policy to use (default: ‘strict-origin-when-cross-origin’)
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-protection-2.2.2/lib/rack/protection/referrer_policy.rb: default_options :referrer_policy => ‘strict-origin-when-cross-origin’
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt:# “Referrer-Policy” => “strict-origin-when-cross-origin”
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.3.1/lib/rails/application/configuration.rb: “Referrer-Policy” => “strict-origin-when-cross-origin”
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/actionpack-7.0.3.1/lib/action_dispatch/railtie.rb: “Referrer-Policy” => “strict-origin-when-cross-origin”
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-protection-3.0.2/lib/rack/protection/referrer_policy.rb: # referrer_policy:: The policy to use (default: ‘strict-origin-when-cross-origin’)
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-protection-3.0.2/lib/rack/protection/referrer_policy.rb: default_options referrer_policy: ‘strict-origin-when-cross-origin’
/var/www/discourse/config/initializers/new_framework_defaults_7_0.rb: “Referrer-Policy” => “strict-origin-when-cross-origin”
grep: /var/www/discourse/tmp/cache/bootsnap/compile-cache-iseq/f6/fc077900e2584e: binary file matches
grep: /var/www/discourse/tmp/cache/bootsnap/compile-cache-iseq/8a/029cf0d9c06e6d: binary file matches
grep: /var/www/discourse/tmp/cache/bootsnap/compile-cache-iseq/25/d90a345e4f734e: binary file matches
لا أعرف حقًا أين يمكنني تعيين same-origin. أي تلميحات؟
RGJ
(Richard - Communiteq)
10 أكتوبر 2022، 4:31م
3
قرصنة سيئة للغاية هنا ولكن
يمكنك حل هذا في nginx عن طريق إضافة proxy_hide_header وتتبعها بـ add_header الخاصة بك.
نعم، اختراق سيء. لا يعجبني ذلك.
أي مساعدة يا هير، أين هو المكان الصحيح الذي يُستخدم في الإنتاج؟