<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello NGINX community,<br>
<br>
nginx gives me the error messages <br>
- "js_import" is not allowed here<br>
and<br>
- "js_content" is unknown</p>
<p>and don't know what I did wrong.<br>
</p>
<p><br>
I have the following NGINX config at '/etc/nginx/nginx.conf'</p>
<pre>load_module modules/ngx_stream_js_module.so;</pre>
<pre>user nginx;</pre>
<pre>worker_processes auto;</pre>
<pre>
error_log /var/log/nginx/error.log notice;</pre>
<pre>pid /var/run/nginx.pid;</pre>
<pre>
events {</pre>
<pre> worker_connections 1024;</pre>
<pre>}</pre>
<pre>
</pre>
<pre>http {</pre>
<pre> #js_path inc/js;</pre>
<pre> js_import http.js ;</pre>
<pre> </pre>
<pre> include /etc/nginx/mime.types;</pre>
<pre> default_type application/octet-stream;</pre>
<pre>
log_format main '$remote_addr - $remote_user [$time_local] "$request" '</pre>
<pre> '$status $body_bytes_sent "$http_referer" '</pre>
<pre> '"$http_user_agent" "$http_x_forwarded_for"';</pre>
<pre>
access_log /var/log/nginx/access.log main;</pre>
<pre>
sendfile on;</pre>
<pre> #tcp_nopush on;</pre>
<pre>
keepalive_timeout 65;</pre>
<pre>
#gzip on;</pre>
<pre>
include /etc/nginx/conf.d/*.conf;</pre>
<pre>
}
</pre>
. NGINX complains about `js_import`<br>
<br>
<pre><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">[emerg] 1#1: "js_import" directive is not allowed here in /etc/nginx/nginx.conf:15
</span></span><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;"></span></span>
</pre>
and about<br>
<br>
<pre><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">unknown directive "js_content" in /etc/nginx/conf.d/app.conf:7
</span></span><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;"></span></span>
</pre>
The file '/etc/nginx/conf.d/app.conf' contains the following<br>
<br>
<pre>server {</pre>
<pre> listen 80;</pre>
<pre>
location /njs {</pre>
<pre> js_content http.hello ;</pre>
<pre># root /var/www/html ;</pre>
<pre> }</pre>
<pre>}</pre>
<p><br>
</p>
<p>I am using the docker image of NGINX.<br>
</p>
<pre><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;"></span></span></pre>
<pre><span style="font-family:monospace"></span></pre>
<pre><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;"></span></span></pre>
<pre><span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;"></span></span></pre>
<span style="font-family:monospace"><br>
</span><span style="font-family:monospace"></span>Cheers<br>
<br>
Sören Reinecke<br>
<span style="font-family:monospace"></span>
<p><br>
</p>
</body>
</html>