Expose over ssl #2838
Answered
by
laurenceisla
risedangel
asked this question in
Q&A
Expose over ssl
#2838
-
I am running postgrest ona server that has a ssl certificate installed. Yet i still cannot send api request via https. How can i achieve this? Will introducing certificate to postgresql itself will suffice? |
Beta Was this translation helpful? Give feedback.
Answered by
laurenceisla
Jun 23, 2023
Replies: 1 comment
-
Hi. If you're using Nginx, for instance, you can adapt the example given in the docs to an https configuration, it would look something like this: http {
# ...
# upstream configuration
upstream postgrest {
server localhost:3000;
}
# ...
server {
listen 443 ssl http2;
# Other configuration for HTTPS
# ssl_certificate...
# ssl_certificate_key...
# etc...
# expose to the outside world
location /api/ {
default_type application/json;
proxy_hide_header Content-Location;
add_header Content-Location /api/$upstream_http_content_location;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_pass http://postgrest/;
}
# ...
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wolfgangwalther
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. If you're using Nginx, for instance, you can adapt the example given in the docs to an https configuration, it would look something like this: