Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /etc/nginx/sites-enabled/default vs /etc/nginx/sites-available/default differences and consequences
- #In the Nginx web server, the /etc/nginx/sites-enabled directory contains symbolic links to configuration files that are actually stored in the /etc/nginx/sites-available directory. The sites-enabled directory is used to enable specific website configurations by creating symbolic links to the configuration files in the sites-available directory.
- #The main difference between these two directories is that the sites-enabled directory contains symbolic links to configuration files that are actively enabled and used by Nginx, while the sites-available directory contains all of the available configuration files for websites, some of which may not be enabled.
- #To enable a website configuration, you would create a symbolic link from a configuration file in the sites-available directory to the sites-enabled directory. For example, you might create a symbolic link using the ln command like this:
- ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
- #This would create a symbolic link to the example.com configuration file in the sites-available directory, and Nginx would use that configuration file when serving requests for the example.com domain.
- #If you want to disable a website configuration, you can simply remove the symbolic link from the sites-enabled directory. For example:
- rm /etc/nginx/sites-enabled/example.com
- #This would remove the symbolic link to the example.com configuration file, and Nginx would no longer use that configuration file to serve requests for the example.com domain.
- #It's worth noting that the default configuration file is a special file that is used by Nginx to handle requests for any domain that does not have a specific configuration file. By default, the default configuration file is located in the sites-available directory, and a symbolic link to it is created in the sites-enabled directory. You can customize the default configuration file to specify how Nginx should handle requests for domains that do not have a specific configuration file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement