mirror of
https://github.com/searxng/searxng.git
synced 2025-08-31 23:46:49 +02:00
The HTTP X-Forwarded-Proto (XFP) request header is a *de-facto* standard header
for identifying the protocol (HTTP or HTTPS) that a client used to connect to a
proxy or load balancer.[1]
The ``X-Scheme`` header was added 10 years ago, why ``X-Scheme`` was used back
then and not ``X-Forwarded-Proto``, nobody knows today / possibly because
``X-Forwarded-Proto`` wasn't a *de-facto* standard back then.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Proto
[2] 6ef7c3276
26 lines
713 B
Text
26 lines
713 B
Text
location ${SEARXNG_URL_PATH} {
|
|
|
|
proxy_pass http://${SEARXNG_INTERNAL_HTTP};
|
|
|
|
proxy_set_header Host \$host;
|
|
proxy_set_header Connection \$http_connection;
|
|
|
|
# see flaskfix.py
|
|
proxy_set_header X-Forwarded-Proto \$scheme;
|
|
proxy_set_header X-Script-Name ${SEARXNG_URL_PATH};
|
|
|
|
# see botdetection/trusted_proxies.py
|
|
proxy_set_header X-Real-IP \$remote_addr;
|
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
|
|
|
# proxy_buffering off;
|
|
# proxy_request_buffering off;
|
|
# proxy_buffer_size 8k;
|
|
|
|
}
|
|
|
|
# To serve the static files via the HTTP server
|
|
#
|
|
# location ${SEARXNG_URL_PATH}/static/ {
|
|
# alias ${SEARXNG_STATIC}/;
|
|
# }
|