分类目录归档:Nginx

nginx restart failed:nginx: [alert] OPENSSL_init_ssl() failed (SSL: error:12800067:DSO support routines::could not load the shared library:filename(/snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/fips.so): /snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/fips.so: cannot open shared object file: No such file or directory error:12800067:DSO support routines::could not load the shared library error:07880025:common libcrypto routines::reason(37):name=fips error:0700006D:configuration file routines::module initialization error:module=providers, value=provider_sect retcode=-1 ) 解决办法

nginx restart failed:
nginx: [alert] OPENSSL_init_ssl() failed (SSL: error:12800067:DSO support routines::could not load the shared library:filename(/snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/fips.so): /snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/fips.so: cannot open shared object file: No such file or directory error:12800067:DSO support routines::could not load the shared library error:07880025:common libcrypto routines::reason(37):name=fips error:0700006D:configuration file routines::module initialization error:module=providers, value=provider_sect retcode=-1 )

解决办法:

nginx restart failed:
nginx: [alert] OPENSSL_init_ssl() failed (SSL: error:12800067:DSO support routines::could not load the shared library:filename(/snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/fips.so): /snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/fips.so: cannot open shared object file: No such file or directory error:12800067:DSO support routines::could not load the shared library error:07880025:common libcrypto routines::reason(37):name=fips error:0700006D:configuration file routines::module initialization error:module=providers, value=provider_sect retcode=-1      )

Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
[root@ooops ~]# find / -name fips.so
/usr/lib64/ossl-modules/fips.so
[root@ooops ~]# mount --bind /usr/lib64/ossl-modules/ /snap/certbot/4325/usr/lib/x86_64-linux-gnu/ossl-modules/

4325注意替换为你的id

$realpath_root 和 $document_root 区别

$realpath_root:

an absolute pathname corresponding to the root or alias directive’s value for the current request, with all symbolic links resolved to real paths

如果是符号链接,$realpath_root指向符号链接的真实路径

$document_root:

root or alias directive’s value for the current request

$document_root 是root或alias指定的值

nginx: worker process is shutting down

nginx: worker process is shutting down,这个是nginx reload后可能会出现的,应该是继续处理未结束线程用的。

如果你的超时相关配置设置了很长时间,那么这个线程也会存在很长时间。

Nginx限流

https://blog.csdn.net/m0_45406092/article/details/124713027

要点:

Example Configuration

http {
    limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

    ...

    server {

        ...

        location /search/ {
            limit_req zone=one burst=5;
        }

rate=1r/s; 表示 1请求每秒,也可以是 rate=30r/m;(30请求每分)

$binary_remote_addr 表示根据 ip v4或者 ip v6地址来限制流量

burst=5;表示突发请求不超过5个

nginx 指定下载文件的文件名

server {
    .....

    location ~* .*\.(doc|txt|jar|zip|apk)(\?.*)?$ {
        if ($request_uri ~* ^.*\/(.*)\.(doc|txt|jar|zip|apk)(\?name=([^&]+))$) {
            add_header Content-Disposition "attachment;filename=$arg_name.$2";
        }
    }