Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to have a root path containing spaces in my nginx.conf

I have tried escaping (and not escaping), with (and without) single quotes double qoutes but i always end up on the 404 page.

is it even possible? i tried searching for it, but landed of https://serverfault.com/questions/361915/how-can-i-make-nginx-recognise-directories-with-spaces-in-its-name but i already tried that, and it didnt work.

if this i just me, then please prove it to me :)

like image 551
bobmoff Avatar asked Apr 03 '14 09:04

bobmoff


People also ask

Does spacing matter in Nginx config?

For most of your nginx. conf this won't hurt anything. If you have quoted strings with multiple spaces those will get changed too by the command above. You can check for that easily by grep ing for quotes in the template.

Where is the Nginx root folder?

On a fresh installation of Nginx, the document root is located at /var/www/html . By following the prerequisite guides, however, you created a new document root, /var/www/ your_domain /html . You may have additional document roots as well.

What is root in Nginx config?

The default Nginx directory on Debian is /var/www/nginx-default . The root is the default location.


1 Answers

I just ran into this issue, too. As long as I did not escape the spaces and used single or double quotes, I was able to use a root path with spaces.

the following works

root "/directory/with spaces not escaped/will work"

this does not work

root "/directory/with\ escaped\ spaces/will\ not\ work"
like image 180
charlie hwang Avatar answered Sep 30 '22 20:09

charlie hwang