Halo, kalau kamu merasa tulisan saya ngebantu kamu, kamu bisa ucapkan terima kasih lewat saweria .

Hello, if you find this article helpful, you can express your gratitude through saweria .



How To

The client wants to host a JSON file at their API (for example: https://ipang.my.id/config/android) .

The Android file is a JSON file, and they want to strip the extension using Nginx. Here’s how to do that:

Just add this line at nginx config

    location = /config/android {
        alias /home/ipang/scripts/android.json;
        #this was a must
        default_type application/json;
        allow all;
        log_not_found off;
        access_log off;
    }

If you want to host .xml files and strip the extension

    location = /config/android {
        alias /home/ipang/scripts/android.xml;
        #this was a must
        default_type type/xml;
        allow all;
        log_not_found off;
        access_log off;
    }

If you want to host .html files and strip the extension

    location = /config/android {
        alias /home/ipang/scripts/android.html;
        #this was a must
        default_type type/html;
        allow all;
        log_not_found off;
        access_log off;
    }

Make sure to replace application/xml and text/html with the appropriate MIME types for your .xml and .html files.