![]() I am in the process of doing triage and can't seem to figure out what the hell happened. I have restored from backup onto a new server and site is running. Now I am just getting default Nginx page. Was working with a plugin to re-apply API so it would call back on the correct url. Was working on removing TLSv1 form Certificate path. Pushed to live environment was working as of my backup this morning. That’s all you need to change the Nginx Web Document Location directory.This was a dev site. Suggestion for you: Permission Command in Linux: chmod $ chmod 644 /home/trendoceans/Documents/sitedata/* $ chmod 755 /home/trendoceans/Documents/sitedata To give all-sufficient permission for accessing the web page within the new document directory, execute the below command by replacing the home and root directory with your own. If Nginx tries to visit your new document directory, it might not have permission to view it. Then most probably, your new document location is not viewable. Getting 403 Forbidden PermissionĪfter making the mentioned changes, if you get an error such as “403 Forbidden Permission” while visiting the domain or localhost. $ sudo systemctl restart nginx įinally, open your Web browser ( Chrome, Firefox, etc.) and type domain or visit localhost. ![]() Nginx web configuration file with modifications in Debian Nginx web configuration file with modifications in RHEL Nginx web configuration file with the modification Restarting the Nginx Web ServerĪfter the configuration is saved with the modification, start or restart the Nginx server using the below command. root /home/trendoceans/Documents/sitedata īelow is the output of the default and nf configuration files after the changes. Nginx web configuration file in Debian Nginx web configuration file in RHEL Nginx web configuration fileįrom the configuration file, we need to find the line starting with “ root“ and comment it with “ #” and then add the below code to the new line of the current “ root” line. $ sudo nano /etc/nginx/nf īelow is the output of the above default and nf configuration files. $ sudo nano /etc/nginx/sites-enabled/default Changing the Configuration Files for NginxĪfter the site data is moved to the new document location, open your Nginx configuration file using TextEditor, as shown below. $ cp -r /usr/share/nginx/html/* ~/Documents/sitedata/Īfter the file is transferred, you can move to the next step configuring your Nginx for the new document location. Open your terminal using Ctrl+Alt+t or Ctrl+Shift+t and execute the below command to move site data from the current location to the new location “ /home/trendoceans/Documents/sitedata“. Moving the Site Data to the New Locationīefore changing the location, you need to first move your site data from the current location.īy default, the Nginx location for storing site data is at “ /usr/share/nginx/html” for Debian/Ubuntu/Fedora/CentOS.Īssuming my new location for storing site data will be in the new directory at “ /home/trendoceans/Documents/sitedata“. This configuration file location might differ from distribution to distribution.įor Debian/Ubuntu distributions, the Nginx Web Server configuration file required to be modified is located at “ /etc/nginx/sites-enabled/default“.įor CentOS/Fedora distributions, the Nginx Web Server configuration file required to be modified is located at “ /etc/nginx/nf“. Web Browser for testing the result ( Chrome, Firefox, etc.)Ĭhanging the default Nginx web document location requires modifications in the configuration file.The drive should be mounted where the new location will be assigned.Nginx Web server is installed on your system.Changing the Configuration Files for Nginx.Moving the Site Data to the New Location.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |