/ + sc.op.fo

redirect to fw.op.fo
This commit is contained in:
fro
2025-10-29 03:38:11 -05:00
parent a2601e8e6a
commit 191d0ebe15

View File

@@ -2,6 +2,27 @@
# configuration of fw.op.fo / frode klevstul / oct 2025 # configuration of fw.op.fo / frode klevstul / oct 2025
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# sc.op.fo ➔ fw.op.fo
server {
listen 80;
server_name sc.op.fo;
return 301 https://fw.op.fo$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
ssl_certificate /etc/nginx/acme.sh/op.fo/fullchain.pem;
ssl_certificate_key /etc/nginx/acme.sh/op.fo/key.pem;
ssl_trusted_certificate /etc/nginx/acme.sh/op.fo/cert.pem;
server_name fw.op.fo;
return 301 https://fw.op.fo$request_uri;
}
# http to https # http to https
server { server {
listen 80; listen 80;
@@ -9,19 +30,6 @@ server {
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
# hw to bare domain for https requests
#server {
# listen 443 ssl http2;
# listen [::]:443 ssl http2;
#
# ssl_certificate /etc/nginx/acme.sh/op.fo/fullchain.pem;
# ssl_certificate_key /etc/nginx/acme.sh/op.fo/key.pem;
# ssl_trusted_certificate /etc/nginx/acme.sh/op.fo/cert.pem;
#
# server_name hw.op.fo;
# return 301 $scheme://op.fo$request_uri;
#}
# upstream configuration for postgrest (used as reversed proxy) # upstream configuration for postgrest (used as reversed proxy)
upstream postgrest { upstream postgrest {
server localhost:3000; server localhost:3000;
@@ -42,11 +50,6 @@ server {
index index.html; index index.html;
server_name fw.op.fo; server_name fw.op.fo;
# redirect 404 not found to the root
#location / {
# error_page 404 = @myownredirect;
#}
location @myownredirect { location @myownredirect {
return 302 /; return 302 /;
} }
@@ -58,23 +61,12 @@ server {
# support /string url style # support /string url style
location ~ ^/(\w+) { location ~ ^/(\w+) {
# # make the response singular
# proxy_set_header Accept 'application/vnd.pgrst.object+json';
# assuming an upstream named "postgrest"
# proxy_pass http://postgrest/$1?id=eq.$2;
default_type application/json; default_type application/json;
proxy_hide_header Content-Location; proxy_hide_header Content-Location;
add_header Content-Location /rpc/$upstream_http_content_location; add_header Content-Location /rpc/$upstream_http_content_location;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_pass http://postgrest/rpc/fwd?p_shortcode=$1; proxy_pass http://postgrest/rpc/fwd?p_shortcode=$1;
#http://178.156.192.201:3000/rpc/fwd?p_shortcode=ph25&p_dbg=false
} }
} }