-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5df8cb7
commit f8beedd
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# gcsproxy | ||
Reverse proxy for Google Cloud Storage. | ||
|
||
## Description | ||
This is a reverse proxy for Google Cloud Storage for performing limited disclosure (IP address restriction etc...). Gets the URL of the GCS object through its internal API. Therefore, it is possible to make GCS objects private and deliver limited content. | ||
|
||
``` | ||
+---------------------------------------+ | ||
| Nginx | | ||
| access controll (basic auth/ip) | | ||
+-----+---------------------------------+ | ||
| | ||
-----------------------------------------+ | ||
| | ||
| | ||
+------v-----+ +---------------+ | ||
| | | | | ||
| gcsproxy | +------> | Google Cloud | | ||
| | | Storage | | ||
+------------+ +---------------+ | ||
``` | ||
|
||
## Useage | ||
|
||
``` | ||
Usage of gcsproxy: | ||
-b string | ||
bind address (default "127.0.0.1:8080") | ||
-v show access log | ||
``` | ||
|
||
**systemd example** | ||
|
||
``` | ||
[Unit] | ||
Description=gcsproxy | ||
[Service] | ||
Type=simple | ||
ExecStart=/opt/gcsproxy/gcsproxy -v | ||
ExecStop=/bin/kill -SIGTERM $MAINPID | ||
[Install] | ||
WantedBy = multi-user.target | ||
``` | ||
|
||
**nginx.conf** | ||
|
||
``` | ||
upstream gcsproxy { | ||
server '127.0.0.1:8080'; | ||
} | ||
server { | ||
listen 8081; | ||
server_name _; | ||
# Logs | ||
access_log off; | ||
error_log /var/log/nginx/gcsproxy.error.log error; | ||
if ($request_method !~ "GET|HEAD|PURGE") { | ||
return 405; | ||
} | ||
location / { | ||
proxy_pass http://gcsproxy$uri; | ||
} | ||
} | ||
``` |