Advertisement
kwabenasapong

Untitled

Dec 20th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.10 KB | None | 0 0
  1. # /etc/nginx/sites-enabled/default vs /etc/nginx/sites-available/default differences and consequences
  2.  
  3. #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.
  4.  
  5. #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.
  6.  
  7. #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:
  8.  
  9. ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
  10.  
  11. #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.
  12.  
  13. #If you want to disable a website configuration, you can simply remove the symbolic link from the sites-enabled directory. For example:
  14.  
  15. rm /etc/nginx/sites-enabled/example.com
  16.  
  17. #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.
  18.  
  19. #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