server { listen 80; listen [::]:80; server_name env.taler.net; rewrite ^ https://$host$request_uri? permanent; } server { listen 443 ssl; listen [::]:443 ssl; server_name env.taler.net; include conf.d/talerssl; root /dev/null; # add trailing slashes to apps rewrite ^/(?[a-zA-Z0-9-_]+)/(?[a-zA-Z0-9-_]+)$ /$user/$app/ redirect; # add trailing slashes to user rewrite ^/(?[a-zA-Z0-9-_]+)$ /$user/ redirect; # relative redirect on landing lage rewrite ^/(?[a-zA-Z0-9-_]+)/redir_app_rel/(?.*) /$user/$req redirect; # relative redirect in apps rewrite ^/(?[a-zA-Z0-9-_]+)/(?[a-zA-Z0-9-_]+)/(.*/)?redir_app_rel/(?.*) /$user/$app/$req redirect; # aliases to get from one page to the other rewrite ^/(?[a-zA-Z0-9-_]+)/(?[a-zA-Z0-9-_]+)/landing /$user/ redirect; rewrite ^/(?[a-zA-Z0-9-_]+)/(?[a-zA-Z0-9-_]+)/bank /$user/bank redirect; rewrite ^/(?[a-zA-Z0-9-_]+)/(?[a-zA-Z0-9-_]+)/shop /$user/shop redirect; rewrite ^/(?[a-zA-Z0-9-_]+)/(?[a-zA-Z0-9-_]+)/donations /$user/donations redirect; location ~ ^/(?[a-zA-Z0-9-_]+)/exchange/admin/(?.*) { proxy_pass http://unix:/home/$user/sockets/exchange-admin.http:/admin/$req; proxy_redirect off; proxy_set_header Host $host; } location ~ ^/(?[a-zA-Z0-9-_]+)/exchange/(?.*) { proxy_pass http://unix:/home/$user/sockets/exchange.http:/$req$is_args$args; proxy_redirect off; proxy_set_header Host $host; } location ~ ^/(?[a-zA-Z0-9-_]+)/merchant-backend/(?.*) { proxy_pass http://unix:/home/$user/sockets/merchant.http:/$req; proxy_redirect off; proxy_set_header Host $host; } location ~ ^/(?[a-zA-Z0-9-_]+)/bank(?/?.*|)$ { uwsgi_pass unix:/home/$user/sockets/bank.uwsgi; include /etc/nginx/uwsgi_params; uwsgi_param SCRIPT_NAME "/$user/bank/"; uwsgi_param PATH_INFO "$req"; } location ~ ^/(?[a-zA-Z0-9-_]+)/shop(?/?.*|)$ { uwsgi_pass unix:/home/$user/sockets/shop.uwsgi; include /etc/nginx/uwsgi_params; uwsgi_param SCRIPT_NAME "/$user/shop/"; uwsgi_param PATH_INFO "$req"; } location ~ ^/(?[a-zA-Z0-9-_]+)/donations(?/.*|)$ { uwsgi_pass unix:/home/$user/sockets/donations.uwsgi; include /etc/nginx/uwsgi_params; uwsgi_param SCRIPT_NAME "/$user/donations/"; uwsgi_param PATH_INFO "$req"; } location ~ ^/(?[a-zA-Z0-9-_]+)(?/.*|)$ { ssi on; uwsgi_pass unix:/home/$user/sockets/landing.uwsgi; include /etc/nginx/uwsgi_params; uwsgi_param SCRIPT_NAME "/$user/"; uwsgi_param PATH_INFO "$req"; } include conf.d/favicon_robots; }