Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bobvanluijt/d438585ed80e487ba0bba29da3a46044 to your computer and use it in GitHub Desktop.
Save bobvanluijt/d438585ed80e487ba0bba29da3a46044 to your computer and use it in GitHub Desktop.
Nginx config file to make Weaviate read only
##
# 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