mirror of
https://github.com/Such-Software/xmrcheckout.git
synced 2026-10-17 05:51:34 +02:00
fix: preserve public HTTPS checkout links
This commit is contained in:
@@ -8,6 +8,14 @@ limit_req_zone $binary_remote_addr zone=global_rate_limit:10m rate=50r/s;
|
|||||||
# restarted. `valid=10s` bounds the stale window to ~10 seconds.
|
# restarted. `valid=10s` bounds the stale window to ~10 seconds.
|
||||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||||
|
|
||||||
|
# Preserve a trusted outer proxy's HTTPS scheme without reflecting arbitrary
|
||||||
|
# client-supplied values into invoice and checkout URLs.
|
||||||
|
map $http_x_forwarded_proto $origin_scheme {
|
||||||
|
default $scheme;
|
||||||
|
http http;
|
||||||
|
https https;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name xmrcheckout.such.software localhost;
|
server_name xmrcheckout.such.software localhost;
|
||||||
@@ -25,7 +33,7 @@ server {
|
|||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $origin_scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api {
|
location /api {
|
||||||
@@ -38,7 +46,7 @@ server {
|
|||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $origin_scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /qr/ {
|
location /qr/ {
|
||||||
@@ -53,6 +61,6 @@ server {
|
|||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $origin_scheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user