Created
June 29, 2022 15:41
-
-
Save bobvanluijt/d438585ed80e487ba0bba29da3a46044 to your computer and use it in GitHub Desktop.
Nginx config file to make Weaviate read only
This file contains hidden or 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
## | |
# Read only Weaviate config. | |
# Update the comments in the config file below | |
# | |
# The setup assumes that Nginx can find the Weaviate instance | |
# or cluster on http://weaviate-server:4001 (this can be updated) | |
# | |
## | |
server { | |
listen 4000 default_server; # port 4000 is where the nginx config listens to | |
listen [::]:4000 default_server; # port 4000 is where the nginx config listens to | |
error_page 404 /custom_error.txt; # change to an error page of choice | |
error_page 500 /custom_error.txt; # change to an error page of choice | |
location = /custom_error.txt { | |
root /usr/share/nginx/html; | |
internal; | |
} | |
location /v1/graphql { | |
if ($request_method = 'OPTIONS') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
if ($request_method = 'POST') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
} | |
location = /v1/meta { | |
if ($request_method = 'GET') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
if ($request_method = 'OPTIONS') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
} | |
location /v1/c11y/concepts { | |
if ($request_method = 'GET') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
if ($request_method = 'OPTIONS') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
} | |
location = /v1/schema { | |
if ($request_method = 'GET') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
if ($request_method = 'OPTIONS') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
} | |
location /v1/objects { | |
if ($request_method = 'GET') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
if ($request_method = 'OPTIONS') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
} | |
location /v1/.well_known { | |
if ($request_method = 'GET') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
if ($request_method = 'OPTIONS') { | |
proxy_pass http://weaviate-server:4001; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment