Skip to content
Snippets Groups Projects
Commit 59956b82 authored by Christopher Zentgraf's avatar Christopher Zentgraf
Browse files

Prevent Apache from serving uploads directly

parent cfeb613c
No related branches found
No related tags found
1 merge request!53Prevent Apache from serving uploads directly
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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'
Loading
Loading
Loading
Loading
@@ -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'
Loading
Loading
Loading
Loading
@@ -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'
Loading
Loading
Loading
Loading
@@ -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'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment