'How to register Options Indexes FollowSymLinks AllowOverride All for directory rule in nginx?

the config file in the Apache site has these lines:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/public/

    <Directory /var/www/html/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <IfModule mod_dir.c>
        DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
    </IfModule>

now I want to add this rule to the Nginx server. I have a shortener URL website that allows customers to use their own custom domain. How do I allow this in the Nginx config file?

Main Domain: www.example.com

If users want to use their own domain they can add unlimited domains that's what I'm trying to achieve with this code. But basically, it's only for the apache and I have installed the script on Nginx server.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source