server {
    listen 80;
    server_name _;
    root /var/www/frontend;
    index index.html;
    client_max_body_size 20m;
    add_header X-Frame-Options SAMEORIGIN always;
    add_header X-Content-Type-Options nosniff always;
    add_header Referrer-Policy strict-origin-when-cross-origin always;
    location / { try_files $uri $uri/ /index.html; }
    location /api/ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
        fastcgi_param SCRIPT_NAME /index.php;
        fastcgi_param HTTP_AUTHORIZATION $http_authorization;
        fastcgi_param HTTP_PROXY "";
        fastcgi_pass app:9000;
        fastcgi_read_timeout 120;
    }
    location = /up {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
        fastcgi_pass app:9000;
    }
    location /storage/ { alias /var/www/html/storage/app/public/; }
    location ~ /\. { deny all; }
    location ~ \.(php|sql|sh|log|env)$ { deny all; }
}
