V
V
VkolV2020-12-30 15:20:54
Nginx
VkolV, 2020-12-30 15:20:54

Why create a symbolic link to public_html?

On the hosting, the instructions say:
For the correct delivery of static content using Nginx, you must create a public symbolic link pointing to public_html.
Link created.
Technical support says that you need to delete the public_html folder, and leave the link.
Questions:
1.Why this link?
2.Did I do the right thing by deleting the public_html folder? For now the link leads to nowhere.
3.Consequences of paragraph 2?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
ge, 2021-01-06
@VkolV

To correctly serve static content using Nginx, you need to create a public symbolic link pointing to public_html.

Apparently you are using shared hosting and the DocumentRoot is hardcoded in the web server settings.
Here the symlink makes sense to force the web server to read another folder, not publiс_html/ .
Delete public_html/ and create a symlink:
ln -s /path/to/public /path/to/public_html

V
Viktor Taran, 2020-12-30
@shambler81

there is no such need, Linux is a constructor and this is one of the options for assembling it.
As a rule, symlinks are used for such thing
/var/www/client322/site3154 /var/www/site.ru
in this case they are stored under a unique identifier and a symlink is just an easy-to-view structar user.
Physically, the web server does not require any links.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question