upstream api { server 127.0.0.1:7039 fail_timeout=0; } server { listen 80; server_name localhost; root /api/api/static/; expires 1m; log_not_found off; access_log off; add_header Access-Control-Allow-Origin *; location /avatar { proxy_pass http://127.0.0.1:7039/avatar; expires 1m; log_not_found off; access_log off; } location /restart { proxy_pass http://127.0.0.1:7039/restart; expires 1m; log_not_found off; access_log off; } location /user_menu/json { alias /api/api/static/templates/user_menu_header.json; default_type application/json; index user_menu_header.json; expires 1m; log_not_found off; access_log off; } location /user_menu/html { alias /api/api/static/templates/user_menu_header.html; default_type text/html; index user_menu_header.html; expires 1m; log_not_found off; access_log off; } location /json { alias /api/api/static/templates/header.json; default_type application/json; index header.json; expires 1m; log_not_found off; access_log off; } location /header/html { alias /api/api/static/templates/header.html; default_type text/html; index header.html; expires 1m; log_not_found off; access_log off; } location /header/html/nextcloud { alias /api/api/static/templates/header_nextcloud.html; default_type text/html; index header_nextcloud.html expires 1m; log_not_found off; access_log off; } location / { try_files $uri $uri/ expires 1m; log_not_found off; access_log off; } }