### Nginx location block for staging site in wp-content subdirectory Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx.html Add this location block when the staging site is installed in the wp-content directory under a subdirectory (e.g., 'udlkbpsb'). Replace the placeholder subdirectory name with your own. The try_files directive serves files or directories, falling back to the index.php for the staging site. ```nginx location /wp-content/udlkbpsb**(replace this with your own subdirectory name)** { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404, #try_files $uri $uri/ = 404; try_files $uri $uri/ /udlkbpsb**(replace this with your own subdirectory name)** / index.php?$args; } ``` -------------------------------- ### Nginx location block for staging site in website root subdirectory Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx.html Add this location block to your Nginx configuration when the staging site is installed in the website root under a subdirectory (e.g., 'monzgvhz'). Replace the placeholder subdirectory name with your own. The try_files directive serves files or directories, falling back to the index.php for the staging site. ```nginx location /monzgvhz**(replace this with your own subdirectory name)** { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404, #try_files $uri $uri/ = 404; try_files $uri $uri/ /monzgvhz**(replace this with your own subdirectory name)** / index.php?$args; } ``` -------------------------------- ### Nginx commands to test and reload configuration Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx.html After making changes to Nginx configuration files, run these commands to check for syntax errors and apply the changes. The first command tests the configuration, and the second reloads Nginx. ```bash sudo nginx -t ``` ```bash sudo systemctl reload nginx ``` -------------------------------- ### Check Nginx configuration syntax Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx-for-a-staging-site.html Use this command to test the Nginx configuration for syntax errors after adding rewrite rules. Run it before reloading Nginx to catch mistakes. ```bash nginx -t ``` -------------------------------- ### Nginx root and server_name directives for staging site on individual domain or subdomain Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx.html Create or edit the Nginx configuration file for the staging domain, ensuring the root and server_name directives are correct. Replace the root folder, domain, and website directory with your own values. ```nginx root /var/www/html/domain.com/wordpress**(replace the root folder of the web server, the domain, and the website directory with your owns)** ; server_name domain.com**(replace this with the individual domain name)** ; ``` -------------------------------- ### Nginx root and server_name directives for mapping a domain to a subdirectory Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx.html Use this configuration when mapping an individual domain to a subdirectory of another site (e.g., mapping dev.b.com to a.com/wordpress/dev). Replace the root folder, domain, and website subdirectory with your own values. ```nginx root /var/www/html/domain.com/wordpress/subdirectory**(replace the root folder of the web server, the domain, and the website subdirectory with your owns)** ; server_name domain.com**(replace this with the individual domain name)** ; ``` -------------------------------- ### Configure curl.cainfo in php.ini Source: https://docs.wpvivid.com/troubleshooting-issues-wpvivid-backup-plugin.html Add this line to php.ini after downloading the latest cacert.pem from https://curl.haxx.se/ca/cacert.pem to resolve the cURL error 60 SSL certificate problem. ```ini curl.cainfo="/path/to/downloaded/cacert.pem" ``` -------------------------------- ### Reload Nginx configuration Source: https://docs.wpvivid.com/add-rewrite-rules-to-nginx-for-a-staging-site.html Use this command to apply the updated Nginx configuration after adding rewrite rules. ```bash sudo systemctl reload nginx ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.