#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { # Path to source alias __FINALPATH__/; # Default indexes and catch-all index index.html; try_files $uri $uri/ /index.html?$args; # 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; } # Deny access to hidden files and directories location ~ ^/(.+/|)\.(?!well-known\/) { deny all; } # 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; proxy_set_header Host __BACKEND__; proxy_set_header X-Real-IP $remote_addr; # doesn't work with some browsers # return 308 $scheme://__DOMAIN__$request_uri; } }