mirror of
https://github.com/gitlabhq/gitlab-recipes.git
synced 2026-01-09 14:37:57 -05:00
Prevent Apache from serving uploads directly
This commit is contained in:
@@ -38,7 +38,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
# needed for downloading attachments
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
# needed for downloading attachments
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
# needed for downloading attachments
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
# needed for downloading attachments
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
RequestHeader set X_FORWARDED_PROTO 'https'
|
||||
|
||||
@@ -66,7 +66,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
RequestHeader set X_FORWARDED_PROTO 'https'
|
||||
|
||||
@@ -64,7 +64,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
RequestHeader set X_FORWARDED_PROTO 'https'
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]
|
||||
|
||||
#Forward all requests to gitlab-workhorse except existing files like error documents
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
|
||||
RewriteCond %{REQUEST_URI} ^/uploads/.*
|
||||
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
|
||||
|
||||
RequestHeader set X_FORWARDED_PROTO 'https'
|
||||
|
||||
Reference in New Issue
Block a user