Nginx: private folder not accesible from web - nginx

I created a default nginx webserver in this location: /var/www/domapi/html
root in default is root /var/www/domapi/html;
I want to store certificates and other private files in a location accessible from my $USER:www-data that can upload, delete and create files (right permission).
Is it secure to use /var/www/domapi/private ?
Of course I will assign right permission for that folder /private.
Because I did not get any answer, I re-ask different...
With a root folder in file default as root /var/www/domapi/html; , is accessible from internet the folder /var/www/domapi/private or no? I think no but I'm looking for an expert answer.
Thank you

Related

Nginx: Wordpress installed at /home/me/* instead of /var/www/html/*

EDIT: All I had to change was the root path in /sites-available/ and change permissions.
So last year I configured my first Nginx server for a Wordpress project. Had the droplet shut off because I was too busy to work on it till now. Long story short...I realized I had Wordpress in my home directory, instead of where I expected it to be /var/www/html/*
Based on my current knowledge, I would use mv for this since /var/www/ does not exist.
If I make the directory /var/www/html/, move everything Wordpress to that directory, and modify the root path in my config file like so
server {
root /var/www/html;
What else has to change?
Tried exactly that and broke it, which I assumed I would. It makes logical sense that that path is referenced elsewhere.
I'm a beginner with Linux and web server config, so pardon my ignorance.
Hoping to learn something, not just be spoon fed the answer
o7

Nginx Server unable to access index.html when the file is inside two subdirectories

I have a project folder. I can access my index.html directly but cannot access it from when its location is under 2 sub-directories. Is there any depth limitations.
Eg: My nginx root directory is: /home/user/projects
I can access the file directly
localhost/index.html
I can access it by
localhost/abc/index.html
But I cant access it from more depth
localhost/abc/assets/index.html
Please give a solution
Had the same problem. Replacing '\' to '/' works for me. So my root was C:\Projects\node, now it is C:/Projects/node

Change the Wordpress URL

I would like to change the URL for my Wordpress:
From this: www.example.com/wordpress
To this: www.example.com/game
What do I need to do?
I tried renaming the Wordpress folder to game but this did not work. It caused a linkage problem with the bank-end database.
which server you are using.
if you are using apache or nginx you need to modify you vhost files accordingly to point to the right directory.
location of these file depend on you server's OS.
commonly it is in /etc/httpd/conf.d/ or /etc/apache2/conf.d/
Not open any file in this www.example.com/wordpress folder, Change permission this folder apply 755 permission, stop apache server or stop xampp. after rename your foder name and start apache server or xammp

How can I access files outside of my webroot when using Vagrant?

I have a directory that contains the following structure:
phpinfo.php
adminer.php
drupal/
Vagrantfile
bootstrap.sh (config file)
index.html (on-boarding information for site-builder, etc.)
My synced folder is drupal (mapped to /var/www/html), but I also want to access phpinfo.php and adminer.php.
A hostname is also setup to be built as a webapp.dev host mapped to this new vagrant guest.
I could make the overall directory the synced folder, but I don't want to create clutter or have to access the site at webapp.dev/drupal.
How can I access both the drupal site as web root but still run the various tools? Is it possible to create an additional virtual host and synced directory that maps to the containing folder structure?
You can configure another synced folder. I'm doing this for certs that should be kept above webroot. Here's an excerpt from my Vagrantfile.
config.vm.synced_folder "./public_html", "/vagrant",
id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]
config.vm.synced_folder "./certs", "/certs",
id: "certs"
Note you have to use a separate id for each folder.

Change the path of a symlinked directory in NGINX

Lets say that I have a directory /var/www/assets/ and within that directory I have a symlink which points to a folder which contains all the latest asset files for my website.
/var/www/assets/asssets -> /var/www/website/releases/xxxxxxx/public/assets
If I configure NGINX to serve asset files from /var/www/assets with the domain assetfilesdomain.com and asset files are prefixed with the directory /asset/ then when that /asset folder's symlink is changed then the updated link is not reflected in NGINX. The way that I see it, NGINX grabs the resolved path for that asset folder when it is started.
Is there any way to get around this?
Reloading nginx (sending a HUP signal to the master process) seems to solve this issue (probably because it starts new workers and shuts down the old ones, gracefully).
it seems like you're using Capistrano. You can override deploy:restart and put the nginx reloading there.

Resources