2023-01-10 15:51:22 +01:00
|
|
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
|
|
|
location __PATH__/ {
|
2021-12-27 18:31:01 +01:00
|
|
|
|
2021-12-31 12:17:58 +01:00
|
|
|
# Path to source
|
2023-01-10 16:10:38 +01:00
|
|
|
alias __FINALPATH__/;
|
2021-12-27 18:31:01 +01:00
|
|
|
|
2021-12-31 12:17:58 +01:00
|
|
|
# Default indexes and catch-all
|
|
|
|
index index.html;
|
|
|
|
try_files $uri $uri/ /index.html?$args;
|
2021-12-27 18:31:01 +01:00
|
|
|
|
2021-12-31 12:17:58 +01:00
|
|
|
# Prevent useless logs
|
|
|
|
location = /favicon.ico {
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
location = /robots.txt {
|
|
|
|
allow all;
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
2021-12-27 18:31:01 +01:00
|
|
|
|
2021-12-31 12:17:58 +01:00
|
|
|
# Deny access to hidden files and directories
|
|
|
|
location ~ ^/(.+/|)\.(?!well-known\/) {
|
|
|
|
deny all;
|
|
|
|
}
|
2021-12-27 18:31:01 +01:00
|
|
|
|
2021-12-31 12:17:58 +01:00
|
|
|
# Include SSOWAT user panel.
|
|
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
|
|
|
|
|
|
|
|
|
|
location ~ ^/(api|.well-known|nodeinfo|proxy|media|emoji|oauth|favicon.*) {
|
|
|
|
|
|
|
|
proxy_pass $scheme://127.0.0.1$request_uri;
|
|
|
|
# proxy_redirect $scheme://__DOMAIN__$request_uri $scheme://soapbox.g0v.moe$request_uri;
|
2023-01-10 15:51:22 +01:00
|
|
|
proxy_set_header Host __BACKEND__;
|
2021-12-31 12:17:58 +01:00
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
|
|
|
# doesn't work with some browsers
|
|
|
|
# return 308 $scheme://__DOMAIN__$request_uri;
|
|
|
|
}
|
2021-12-27 18:31:01 +01:00
|
|
|
|
|
|
|
}
|
2021-12-31 12:17:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|