Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all 7229 articles
Browse latest View live

How to install njs after building from sources (1 reply)

$
0
0
Hello,

I built NGINX and njs from sources. Now I have njs executable and some
static object files under ~/njs/build.

How should I install njs or configure NGINX to run with njs?

regards,
mustafa
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Trying to setup SSL - Error too many redirects (no replies)

$
0
0
server {
listen 80;
listen [::]:80;
return 301 https://$host$request_uri;
ssl_certificate /etc/ssl/certs/bluegrasscounty/certificate.crt;
ssl_certificate_key /etc/ssl/certs/bluegrasscounty/private.key;
server_name *.bluegrasscounty.com www.bluegrasscounty.com
bluegrasscounty.com;
charset utf-8;
location / {
root /usr/home/fugee/websites/bluegrasscounty/public;
rails_env production;
# passenger_enabled on;
}
}
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Error_log format (json) or suggestions? (no replies)

$
0
0
Howdy,

I've a project that I need to send the error log but it only accepts
json format (I know I know), in the past I used logstash but right now
that is not an option so looking to see if anyone has done any patch
or ways to go around it.

Ideally this should either be any of:

a) Log to current error_log as json (through a patch)
b) Or log to the current error_log in the current format and have a
separate process that processes it and creates a new log file with the
json format (we are fine with ending with two files)

Any ideas?

Thanks!
--
Pablo
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Multiple Domain CORS (2 replies)

$
0
0
Hi All,

I would like to use cloudfront.net content inside my webapp and its
throwing Access-Control-Allow-Origin error and have added the header for
single host on Nginx to make it work now.

The problem is we have multiple environments which is trying to do the same
and I have to whitelisted all domains. I don't want to add '*'. Chrome is
throwing error and not accepting multiple values.

Is there anyway to allow CORS domain like based on Host Origin.For Options,
Get and other methods.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Actions after cache miss is detected (no replies)

$
0
0
Hello,

Is there a way to perform an action after a cache miss is detected but before the request is forwarded to the upstream server?

Specifically, on a cache miss I want to:
Return a response instead of forwarding the request to the upstream server.
Trigger a handler (module or script) that executes asynchronously to the request.

The latter I could do by looking at the logs. But I was wondering if there is a more elegant way.

Thanks…

Roger



_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Regarding nginx load balancing based on cpu, memory (no replies)

$
0
0
hi experts,

We had tried hash type load balancing (explorer other types too), but we
could not find a rule / config where it can load balance based on cpu or
memory limit of application server

Do we need write plugin ourselves for the same ?

Thanks,
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

PROXY protocol to upstream server (2 replies)

$
0
0
Hi,

It seems that nginx can accept PROXY protocol fine, but when it comes to forwarding, it can only do so only within a stream { server { … proxy_protocol on; } } .

Are there any plans to add proxy_protocol on; for regular HTTP server blocks so it can be used alongside proxy_pass? This would come in very handy in a situation where NGINX is used as SSL terminator, e.g.:

NGINX (SSL) → (Proxy protocol) → Varnish.

Varnish supports accepting PROXY protocol.


Best Regards,
Danila

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reminder: Help Shape the Future of NGINX in the 2018 User Survey (no replies)

$
0
0
Hello-

Sending out a friendly reminder: our annual NGINX User Survey is now open.
Your feedback is incredibly important in helping us shape our products and
services to better serve you.

If you haven’t yet, please take ten minutes to share your thoughts:
*https://nkadmin.typeform.com/to/e1A4mJ?source=email
https://nkadmin.typeform.com/to/e1A4mJ?source=email *

Best,
Kelsey



--
*Join us at NGINX Conf 2018 https://www.nginx.com/nginxconf/2018/, Oct
8-11, Atlanta, GA*

Kelsey Dannels
Marketing Communication Specialist
Mobile: 650 773 1046
San Francisco
https://nginx.com/
https://www.linkedin.com/company/2962671 https://twitter.com/nginx
https://www.facebook.com/nginxinc
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Nginx C API: Traversing the configuration tree (1 reply)

$
0
0
Hi all,

I’m writing a small monitoring module and I need to perform some set-up after the configuration object has ben initialised. I use the postconfiguration-hook in ngx_http_module_t and would like this hook to traverse over all locations that have been enabled in my module in order to initialise some state and set up some (database) connections. Does anybody know how to traverse the locations when given the root ngx_conf_t? I’ve found ngx_http_location_tree_node_t but I’ve failed to decipher how exactly it works. Besides that, is this the right way to do so, or is there some clever location-specific postconfiguration-hook that I’m missing?

Many thanks,
Sam_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

hostname based listen directive with A/AAAA RRs (1 reply)

$
0
0
Hello,

Will the following listen statement bind to all addrs (2xIPv4 and
2xIPv6)?

server {
listen www.nginx.org:443 ssh http2 ipv6only=no bind;
....
}


-Jim P.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

nginx error (connect() failed, 61 "Connection refused", but everything works) (3 replies)

$
0
0
I have a set of minio (S3-compatoble block storage) servers running behind nginx on macOS High Sierra. While everything seems to work OK, I have noticed an unexplained error in the nginx logs.
For instance, when I use minio’s mc to ls a file:
mc ls nginx/gerbentest/duplicati-ifdb6b7ac174b4e5094b04e7321d10c6b.dindex.zip.aes
mc reports (as expected):
[2017-12-21 20:36:41 CET] 36KiB duplicati-ifdb6b7ac174b4e5094b04e7321d10c6b.dindex.zip.aes

So, everything works. So does duplicati (the backup solution that uses those mini backends). I can also connect direct to the servers and it works fine.

But nginx reports (apparently once per session):
2018/08/15 11:34:48 [error] 242#0: *881 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 192.168.2.67, server: MYHOST, request: “GET /gerbentest/?delimiter=%2F&max-keys=1000&prefix=duplicati-ifdb6b7ac174b4e5094b04e7321d10c6b.dindex.zip.aes HTTP/1.1”, upstream: “http://[::1]:9003/gerbentest/?delimiter=%2F&max-keys=1000&prefix=duplicati-ifdb6b7ac174b4e5094b04e7321d10c6b.dindex.zip.aes”, host: “MYHOST:9000”

I’d like to find out why this happens. Can someone help me find the cause of these errors? The config for the minio servers is:

server {
listen 9000 ssl;
server_name MYHOST;
ssl_certificate minio_certificate_chained.crt;
ssl_certificate_key minio_certificate.key;
ssl_protocols TLSv1.2;
proxy_buffering off;
client_max_body_size 1000m;
location / {
proxy_set_header Host $http_host;
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=REMOVED") {
proxy_pass http://localhost:9001;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=REMOVED") {
proxy_pass http://localhost:9002;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=REMOVED") {
proxy_pass http://localhost:9003;
}
if ($http_authorization ~* "^AWS4-HMAC-SHA256 Credential=REMOVED") {
proxy_pass http://localhost:9004;
}
}
}


Gerben Wierda
Chess and the Art of Enterprise Architecture http://enterprisechess.com/
Mastering ArchiMate http://masteringarchimate.com/
Architecture for Real Enterprises https://www.infoworld.com/blog/architecture-for-real-enterprises/ at InfoWorld
On Slippery Ice https://eapj.org/on-slippery-ice/ at EAPJ

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Using Nginx for TCP Mirroring (no replies)

$
0
0
Hi,

Can any one help in using Nginx for TCP mirroring. i.e We want to send 1 TCP request to 2 servers.

There is a module ngx_http_mirror_module, http://nginx.org/en/docs/http/ngx_http_mirror_module.html which can do http mirroring, but we want to do for TCP mirroring.

Thanks,
Ankit Chopra

Perhaps you will come into rage, but it's better than to dwell in the dark (no replies)

Feature request (no replies)

$
0
0
Hi

Not sure where to put this.

But I would like to have the ability to add client cert required any where
on the URI tree

so

www.abc.com.au/ you can access with out a cert but
www.abc.com.au/private/ you need a cert
www.abc.com.au/public/ no cert needed


A
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

WordPress multisite with root url as Laravel application (1 reply)

$
0
0
I am running a wordpress multisite website with subdomain option. example.me is my main website https://one.example.me, https://two.example.me/two etc are the network websites.

Now I am planning to have a small laravel application accessible at example.me. I tried using different combination but not able to figure this out. Could not find any examples in search results as well.Can someone let me know how can I use laravel webapp at main/root address https://example.me and mutilsite with subdomain ?

I am new to NGINX. Here is my nginx code.

map $http_host $blogid {
default 0;
include /var/www/goingplacesme/wp-content/uploads/nginx-helper/map.conf;
}

server {
listen 80;
listen [::]:80;

root /var/www/exampleme;

index index.html index.htm index.nginx-debian.html;

server_name example.me www.example.me;

location / {
#try_files $uri $uri/ =404;
try_files $uri /index.php$is_args$args;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include snippets/fastcgi-php.conf;

# With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
location ~ ^/files/(.*)$ {
try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ;
access_log off; log_not_found off; expires max;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
}

location ^~ /blogs.dir {
internal;
alias /var/www/pathtoyoursite/web/wp-content/blogs.dir ;
access_log off; log_not_found off; expires max;
}



if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}

}

making telnet secure using Nginx redirect options (no replies)

$
0
0
Hi All,
We have a traditional custom server which is based on telnet at port 9932.
Can we make it secure by just using Nginx.conf setting.

something like:
location /mytelnet {
grpc_pass telnet localhost 9932;
}


Assume telnet client is my own application, it can iniitate https
connection with mytelnet prefix.

9932 is example port where custom server is running.

Regards,
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

rewrite rule: MediaWiki to static site (1 reply)

$
0
0
Hello.
I'm diverting traffic from an retired MediaWiki site to an active static site. I'm somewhat confused with the process of `rewrite`-ing old URLs with a query string to standard URLs *without* a query string on the static site. For clarity, I do not need or want query strings on the new site.

Retired URLs examples:

https://example.com/wiki/index.php?title=en/Main_Page
https://example.com/wiki/index.php?title=Glossary
https://example.com/wiki/index.php?title=Category:Troubleshooting

New URLs examples:

https://example.net/MainPage
https://example.net/Glossary
https://example.net/Troubleshooting

All the retired URLs are attached to `/wiki/index.php` with a single query string.

There is no direct correlation between the old URLs and the new ones, and I have a before-and-after list of URLs to put into a 200+ entry `rewrite` list.

My question is two-fold:

1) Is it better (objectively) to have all the rewrite rules inside a `location` referring to `/wiki/index.php` since the only non-Mediawiki URL on the retired site is `/`?
2) How can I best build the `rewrite` list without using `if` or nested `map`?

I am grateful for your time and attention, and I would very much appreciate an example rewrite rule and/or some reading recommendations for `rewrite` with query strings.

Thank you.

Help Shape the Future of NGINX in the 2018 User Survey (no replies)

$
0
0
*Hello- Our annual NGINX User Survey closes Wednesday (8/22). Your feedback
is incredibly valuable to us, so if you haven’t yet, please take 10 minutes
to complete the survey.Link to survey:
https://nkadmin.typeform.com/to/e1A4mJ?source=email
https://nkadmin.typeform.com/to/e1A4mJ?source=email Best,Kelsey *

--
*Join us at NGINX Conf 2018 https://www.nginx.com/nginxconf/2018/, Oct
8-11, Atlanta, GA*

Kelsey Dannels
Marketing Communication Specialist
Mobile: 650 773 1046
San Francisco
https://nginx.com/
https://www.linkedin.com/company/2962671 https://twitter.com/nginx
https://www.facebook.com/nginxinc
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

How to produce stale event for nginx (no replies)

$
0
0
I am studying nginx by reading and debugging source code. I want to produce the stale event, what is the simplest way to make it happen?
Thanks very much

“max_conns” in upstream is not working what I've expected; (no replies)

$
0
0
Hello Super Heroes.

I want to limit connections in a service. So I used max_conns directive in upstream.

But it allows twice connections as many as I've set.

So, I suspected myself. Maybe… Am I used the direction in wrong way.

And I found some descriptions about “max_conns” exception rules.

http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server

----
If idle keepalive connections, multiple workers, and the shared memory are enabled, the total number of active and idle connections to the proxied server may exceed the max_conns value.
----

And I’ve tried change configuration of “keepalive”, “worker numbers” and “shared memory”. But it still the same. It allowed twice connections as many as I expected.


My config file is blow.

#
# max_conns Test Server
#

proxy_cache_path /etc/nginx/cache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60s use_temp_path=off;

proxy_cache_key "$scheme$request_method$host$request_uri";

upstream t10 {
zone t1_z 1M;
server localhost:8080 max_conns=5 max_fails=0 fail_timeout=1s;
}

server {
listen 8000 ;
location /test/1 {
proxy_pass http://t10; # it takes 1 seconds
}
}

And I run a shell script blow.

for v in {1..40}
do
curl 'localhost:8000/test/1' -i -l >> 30_2.log &
sleep 0.01
done

----

The url ‘localhost:8080/test/1’ takes 1 seconds.

I expected 5 succeed and 35 fail. But it always 10 succeed, 30 failed.
Viewing all 7229 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>