• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved nginx error 404 newly created website

christian

Basic Pleskian
on plesk 12.5 centos 7 , when we create new website, we have a problem of error 404 for files (js, css and others)
we was verified files, rights and owner, all, are good.
the only way to resolve it is to restart nginx.
but, it's a real problem for us, because the server host lot of websites.
restarting nginx cause loss of requests fr other websites.
there is any way to force refresh or delete cache of nginx, without restarting it,
or
Additional nginx directives to force refresh for the website.?

i don't know for now how to configure correct nginx directive, help welcome.;
 
Hi christian,

you have the choice to use ( logged in as user "root" over SSH ):
Code:
service nginx reload
... which will reload all of you configuration files. There is as well the option to use:
Code:
/usr/sbin/nginx -s reload


Additional informations:


You should consider to use as well
Code:
nginx -t
BEFORE a nginx restart/reload, as this will point you directly to possible issues/errors/problems or misconfigurations. ;)

Consider as well to read => CommandLine | NGINX for additional commands/informations for nginx over your command line.
 
tested reload but it isn't effective.

searched more and found working solution.

i founded infos in logs saying "too many open files"
controling with
Code:
cat /proc/$(cat /var/run/nginx.pid)/limits|grep open.files
i got
Code:
Max open files            1024                 4096                 files
it seem the cause.

to resolve.
modify LimitNOFILE in /etc/systemd/system/nginx.service
Code:
vi /etc/systemd/system/nginx.service
after
Code:
# tuning of limits settings:
# 1. fill required limits as described in systemd.exec(5)
#       nginx.systemd content example for number of open files:
#       [Service]
#       LimitNOFILE=8192
# 2. restart service
add
Code:
[Service]
LimitNOFILE=65536
save file,
reload daemon
Code:
systemctl daemon-reload
restart nginx
Code:
systemctl restart nginx
and check result
Code:
cat /proc/$(cat /var/run/nginx.pid)/limits|grep open.files
Max open files            65536                65536                files
Code:
ps --ppid $(cat /var/run/nginx.pid) -o %p|sed '1d'|xargs -I{} cat /proc/{}/limits|grep open.files
Max open files            65536                65536                files
you will get line result for each nginx workers defined in /etc/nginx/nginx.conf -> worker_processes 1;
in my case i defined 4 workers, for 8 core server. so i got 4 lines returned.

so, stay a question, is that a good way to do?? or there is better/more secure way.?
 
Last edited:
Back
Top