server {
    listen 80;
    server_name colgatemy-test.skale.today;
    
    # Let Laravel know original host + https was used
    real_ip_header X-Real-IP;
    real_ip_recursive on;
    set_real_ip_from 0.0.0.0/0;

    # Because Apache handles SSL
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;

    client_max_body_size 100M;

    # Default Laravel root
    root /var/project/public;
    index index.php index.html;

    location = /php.ini { return 302 /; }
    location = /.htaccess { return 302 /; }
    location = /.env { return 302 /; }
    location = /.git { return 302 /; }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass colgatecny-app:9000;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 300s;
    }
}
