• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Issue Error at save - unknown directive "secure_link" nginx module

Andr39

New Pleskian
I try to save via Plesk some nginx rules for a module (ngx_http_secure_link_module) and i receive an error. The rules work on an a test server without Plesk.

Plesk v. 12.5.30
Plesk > files.example.com > Apache & Nginx settings

I try to save this in textarea:
Code:
location /downloads/ {
	valid_referers none blocked server_names
	               *.example.com example.com;

	if ($invalid_referer) {
	    return 403;
	}

    secure_link $arg_st,$arg_e;
    secure_link_md5 "secret$uri$arg_e$remote_addr";

    root /var/www/vhosts/example.com/files.example.com;
    if ($secure_link = "") {
            return 403;
    }
    if ($secure_link = 0) {
            return 410;
    }

}

The error in red is
Code:
Invalid nginx configuration: nginx: [emerg] unknown directive "secure_link" in 
/var/www/vhosts/system/files.example.com/conf/vhost_nginx.conf:9 nginx: 
configuration file /etc/nginx/nginx.conf test failed
 
It sems the module is not enabled
Code:
nginx -V
nginx version: nginx/1.11.1
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: 
--prefix=/usr/share 
--sbin-path=/usr/sbin/nginx 
--conf-path                       =/etc/nginx/nginx.conf 
--modules-path=/usr/share/nginx/modules 
--error-log-path=                       /var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log 
--lock-path=/                       var/lock/nginx.lock 
--pid-path=/var/run/nginx.pid 
--http-client-body-temp-path=/                       var/lib/nginx/body 
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
--http-proxy-                       temp-path=/var/lib/nginx/proxy 
--http-scgi-temp-path=/var/lib/nginx/scgi 
--http-                       uwsgi-temp-path=/var/lib/nginx/uwsgi 
--user=nginx --group=nginx 
--with-ipv6 --wi                       th-file-aio 
--with-http_v2_module 
--with-http_ssl_module 
--with-http_realip_modu                       le 
--with-http_sub_module 
--with-http_dav_module 
--with-http_gzip_static_module                        
--with-http_stub_status_module 
--add-dynamic-module=/usr/share/passenger/ngx_htt                       p_passenger_module

Do you know which is the easiest way to enable it? Thanks
http://nginx.org/en/docs/http/ngx_http_secure_link_module.html
 
Back
Top