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
|
2024-01-12 14:53:23 +01:00
|
|
|
alias __INSTALL_DIR__/;
|
2021-12-27 18:31:01 +01:00
|
|
|
|
2024-01-12 14:53:23 +01:00
|
|
|
try_files $uri /index.html;
|
|
|
|
|
|
|
|
location = /index.html {
|
|
|
|
expires 30s;
|
|
|
|
}
|
|
|
|
|
|
|
|
# the nginx default is 1m, not enough for large media uploads
|
|
|
|
client_max_body_size 40m;
|
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
|
|
|
|
2024-01-12 14:53:23 +01:00
|
|
|
# here goes long list of what we will use from real instance
|
2021-12-31 12:17:58 +01:00
|
|
|
location ~ ^/(api|.well-known|nodeinfo|proxy|media|emoji|oauth|favicon.*) {
|
|
|
|
|
|
|
|
proxy_pass $scheme://127.0.0.1$request_uri;
|
2024-01-12 14:53:23 +01:00
|
|
|
# proxy_redirect $scheme://__DOMAIN__$request_uri $scheme://soapbox.__DOMAIN__$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
|
|
|
|
2024-01-12 14:53:23 +01:00
|
|
|
# Include SSOWAT user panel.
|
|
|
|
include conf.d/yunohost_panel.conf.inc;
|
2021-12-27 18:31:01 +01:00
|
|
|
}
|