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

Nginx Location Block (2 replies)

$
0
0
heya-

I'm having some interesting dramas with Nginx location block. I put it
down to a misconfiguration in my conf files, but I can't locate what it
possible could be.

Briefly, my setup is using an Nginx frontend server to do SSL offloading
then pass requests to my backend Nginx servers which then process the
request via fastCGI.

My issue is when I try to access URIs like /cms/index.php?blah, the
frontend Nginx gives 404. Access with /cms/ and Nginx passes the request
to the backend.

Here is my frontend location block:

location / {
limit_req zone=root burst=300;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HTTPS on;
proxy_set_header X-Forwarded-HTTPS on;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_pass http://webpool;
}

Here is my log entry for accessing the URI.

"25/May/2015:14:33:01 +1000" "example.com" -275 428 "GET /cms/index.php
HTTP/1.1" "404" "-" "10.107.0.8" "Mozilla/5.0 (X11; Linux x86_64;
rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.6.0"

What I don't understand is this, why does Ngnix pass the URI /cms/ to my
backend fine, but add /cms/index.php to the end and it does not pass to
the backend?

I've read and re-read the below and I'm drawing blanks, as my
understanding is, it should work.
-
https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms

- http://nginx.org/en/docs/http/ngx_http_core_module.html#location

Many thanks in advance for helping me understand my problem.

--julian

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

Nginx and Websphere (no replies)

$
0
0
Hi all!

I'm new in NGINX but I have try everything with very bad results. My scenario is:

NGINX balancing over 2 servers using ip_hash. This servers runs Websphere and in every Websphere runs several apps.

Servers separately runs:

wasint-1.domain.com:9080/WebApp
wasint-2 domain.com:9080/WebApp

My configuration:

upstream webint {
ip_hash;
server wasint-1.domain.com:9080;
server wasint-2.domain.com:9080;
}

server {

listen 80;
server_name web.domain.com;


location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://webint/WebApp;
}

}

All seems to be ok, but when I type in the web browser http://web.domain.com doesn´t work.

nginx-1.9.1 (no replies)

$
0
0
Changes with nginx 1.9.1 26 May 2015

*) Change: now SSLv3 protocol is disabled by default.

*) Change: some long deprecated directives are not supported anymore.

*) Feature: the "reuseport" parameter of the "listen" directive.
Thanks to Sepherosa Ziehau and Yingqi Lu.

*) Feature: the $upstream_connect_time variable.

*) Bugfix: in the "hash" directive on big-endian platforms.

*) Bugfix: nginx might fail to start on some old Linux variants; the bug
had appeared in 1.7.11.

*) Bugfix: in IP address parsing.
Thanks to Sergey Polovko.


--
Maxim Dounin
http://nginx.org/

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

nginx on Debian: dynamic network interfaces (6 replies)

$
0
0
Hello,

Facing issues on Debian with official nginx packages, I filled a bug up on
the Debian tracker which ended up as being closed since Debian refers to
the faulty service(s), nginx being one.

​Bug #785253 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=785253​

​I could not fill a bug on http://trac.nginx.org/nginx/ since OAuth 2.0
authentication through Google went away (already adressed in a separated
thread).

Could someone here confirms nginx (and not the OS) is to be adressed?
Thanks,
---
*B. R.*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Measuring request processing time (2 replies)

$
0
0
Hi!

Is there a way to measure time Nginx takes to process request? Not
$request_time, but rather something like "time between request was fully
read and request is ready to pass it to the backend".
I need it to evaluate perfomance of the geoip2 module:
https://github.com/leev/ngx_http_geoip2_module

I need this because I've measured speed of official MaxMind Perl modules
for legacy and new versions of their databases and found that lib for new
version is hundreds times slower than legacy. (yes, I've used XS version)
Now, I will be using new format anyway - because MaxMind provide only free
legacy databases, and free databases have way too bad accuracy.
But I would like to assess the consequences.

Best regards,
Dmitriy Shalashov
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

host names in 1.9 (1 reply)

$
0
0
I'm having some difficulty using the stream directive in 1.9. I may be using it wrong, so please correct me if this is incorrect or not possible.

stream {
server {
listen 1520;
server_name customhost.example.com
proxy_pass db;
}
upstream db {
server 10.100.0.104:1523;
}
}

I have multiple host names (server_name s) that I want to hit 1520 and be proxied to different upstream dbs. I have a second stream context with a different server_name and different upstream db. I can't get this to work. I think I'm missing something. How would I accomplish this? ultimate goal: reverse proxy a database connection based on host name.

unknown directive "thread_pool" (2 replies)

$
0
0
Hi
First time trying aio threads on linux, and I am getting this error

[emerg] 19909#0: unknown directive "thread_pool" in
/usr/local/nginx/conf/nginx.conf:7

Line7 reads:
thread_pool testpool threads=64 max_queue=65536;

Everything indicates it was built --with-threads, so I'm not sure where
to go from here

nginx -V:
/usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.9.1 built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
configure arguments: --with-debug --with-file-aio --with-threads

from configure output:
Configuration summary
+ using threads

Any help appreciated
Thanks
Richard

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

NGINX rtmp module multiple push and grab from another app? (no replies)

$
0
0
Hey, guys!

I have problems with the rtmp module. There is an input application, that
pushes "xyz" to the "2nd" application, that exec_pushes with ffmpeg to a
"3rd" application. From "3rd" it gets pushed to 2 rtmp servers and to
"rtmp://localhost/4th" - The problem is, that I can't grab
"rtmp://IP/4th/xyz" for some reason, but it's OK when I try from "3rd". Any
ideas? :/



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

sock error (3 replies)

$
0
0
Hi, i have a rails app using unicorn + nginx.
Last month my app started to get really slow and giving me error 502.
Unicorn log doesn't show nothing, either my rails app log.
But looking at nginx error log, i get numerous:

[error] 1837#0: *263157 connect() to unix:/tmp/.app.sock failed (11: Resource temporarily unavailable) while connecting to upstream,


What could it be? What causes this?

If I change from socket to tcp connection, my tcp connection doesn't give this error, but gets time out.

Thanks for any help.

noob needs help with alias locations and php (1 reply)

$
0
0
Hi all,

Been going in circles for the third day now.

The server handles files and php scripts as long as they are at or
beneath the document root. Here are the two problems I haven't been
able to figure out:
Directory index of ... is forbidden
Can't get to docs not beneath the document_root.

Example of places I want to go:

non-root targets: as:
/home/mike/Movies/index.html /movies/index.html 200
/home/mike/Movies/index.php /movies/index.php "File not found."
/home/mike/Movies/1/index.html /movies/1/index.html 404
/home/mike/Movies/1/index.php /movies/1/index.php "File not found."

File not found : "Primary script unknown";
404 : the log shows the correct GET path;
A lot of my experiments end up with 301 : endless redirects;

http {
index index.html index.php;
...

server {
listen 80;
server_name localhost lo;
root /var/www/sites/localhost/www;

location / {
try_files $uri $uri/ /index.html /index.php;
}

location /movies {
alias /home/mike/Movies/;
}

location ~ \.php$ {
root /var/www/sites/localhost/www;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

If I can get past these hurdles I'll probably (hopefully) be able to
figure most of the rest of this stuff out.

Tips, pointers appreciated. Helper?

Thanks,
Mike Wright

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

"[emerg]: bind() to 0.0.0.0:80" and relation between 'logs' directory and 'pid' direction (1 reply)

$
0
0
Hello,

I had compiled my Nginx using '.configure', 'make' and 'make install' commands.

nginx.pid file occurs on 'logs' directory as default. If I change set 'pid' directive (e.g. pid sbin/nginx.pid) on my nginx.conf file then I cannot restart Nginx and I get following message at second restart service.

[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)

And if I change the direction as 'pid logs/nginx.pid' everything is perfect!

Would it be possible to change Nginx default settings?

Nginx Session Draining (2 replies)

$
0
0
Hi,

I read about the Nginx Session Draining feature. Looks like it is also available in the non commercial version.

http://nginx.com/products/session-persistence/#session draining

But, it does not tell me how to configure this in the upstream block.

Any help?

Thanks...

[Nginx] How to support file upload in Nginx 1.8 (no replies)

$
0
0
Hi
I am using Nginx 1.8 version, and Is it default support file upload, I
found there is

clientbodyinfileonly in Nginx, so is it official method to support file upload>?

Thanks~

--
Rejoice,I Desire!

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

Supporting special characters in URI for location block (1 reply)

$
0
0
I have a URI with spanish characters that needs to be handled in location block specific to it e.g. I want to do location <URI with spanish characters> {}
However, nginx does not seem to match URI in location block  with spanish (or any other characters including chinese). Is this functionality supported?Thanks_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

nginx-rtmp-compile-for-windows error??? help (2 replies)

$
0
0
Im experiencing issues with compiling Nginx on Windows 7, every thing goes good until nmake -f objs/Makefile.
I get the following error

Assembling: tmp32\sha1-586.asm
tmp32\sha1-586.asm(1432) : error A2070:invalid instruction operands
tmp32\sha1-586.asm(1576) : error A2070:invalid instruction operands
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\ml.EXE"' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\nmake.exe"' : return code '0x2'
Stop.

[OT] Cant write across filesystem mounts? (1 reply)

$
0
0
Hi I dont think this is specific to nginx but I hope its a good
place to ask!

When running PHP script through Nginx it writes OK to files
on the same disk mount where the PHP file is located but
not to the other parts of the system that are on another mount.
(well i dont know if its a matter of "same mount" or not, but
that is how it is behaving)

Example, /tmp is on another mount than the web root.

<?php
ini_set('display_errors', 'On');
file_put_contents('/tmp/test', 'hello world');
system('touch /tmp/test-touch');
file_put_contents('/webroot/tmp/test', 'hello world');
system('touch /webroot/tmp/test-touch');
?><html><body>hello world</body></html>

I run this script from CLI (sudo as ANY user including the php
user) and it always works fine (writes files in both places). If I
access it from a browser the write/touch commands to /tmp
fail silently.

No AVC from selinux, no PHP or Nginx errors or warnings.
/tmp permissions are usual 777. Can someone help me in
right direction?

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

mail proxying (4 replies)

$
0
0
Hi

I'm setting up nginx as a reverse proxy for a postfix / dovecot setup.

My imap server requires STARTTLS usage. Nginx seems to not issue STARTTLS command before forwarding users credentials.

Here is the error I found in /var/log/nginx/error.log

[error] 928#0: *20 upstream sent invalid response: "* BAD [ALERT] Plaintext authentication not allowed without SSL/TLS, but your client did it anyway. If anyone was listening, the password was exposed.

I did not found anything in the documentation to ask nginx to issue STARTTLS command to the upstream server. Is there a way to achieve this ?

I did not tried pop3 yet, but I'm expecting the same annoyance. and the same answer; let me know if I'm wrong.

Add header based on fastcgi response (no replies)

$
0
0
Good morning!

I'd like to add a X-Fastcgi-Cache header when there is a fastcgi cache
hit, when the response is stored to or retrieved from the cache.

add_header X-Fastcgi-Cache 600;

Could you help me?

Thank you.

Szépe Viktor
--
+36-20-4242498 sms@szepe.net skype: szepe.viktor
Budapest, XX. kerület

Szépe Viktor
--
+36-20-4242498 sms@szepe.net skype: szepe.viktor
Budapest, XX. kerület




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

How to send a REST request to another node if the service on the current node is not available? (1 reply)

$
0
0
Hi, All,

We setup a cluster of three nodes and running ngix on each node to load balance.

I found that if a REST service is unavailable on current node, the corresponding REST request sending to this node
will return the service unavailable response to the client. Is there a way (e.g. configuration parameter) to let ngix service running in this node
to redirect the REST request to another node automatically in this case?

Thanks

Boying

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

proxy_cache not working anymore in 1.8 (2 replies)

$
0
0
Hi

We use nginx as proxy_cache and identified a different somehow weird
behaviour compared to 1.6.:

In some situations we get a MISS or EXPIRED in 1.8, where with the same
config, same resource and same origin, we got a HIT in 1.6.

The weird thing is, it does never change to a HIT even after several
requests to the same resource! We always get MISSED or EXPIRED. We do
not use proxy_cache_min_uses.

Below I show you some configs, nothing really fancy. Does anyone use 1.8
for proxy_cache?

1.6: rpm spec and sources:
https://github.com/swisstxt/rpm-pcache/commit/cabe5f83b8c02ae8ce74543f669c9b0c0fc41f03

1.8: rpm spec and sources:
https://github.com/swisstxt/rpm-pcache/commit/da336fd143e21500e445df4a5ece0af7f8a9448b


Response from ORIGIN:

Cache-Control: public, max-age=49
Content-Type: application/json; charset=utf-8
Content-MD5: O+EP2TJJZQZr61/mhkVqdA==
Expires: Mon, 01 Jun 2015 11:09:05 GMT
Last-Modified: Mon, 01 Jun 2015 11:08:05 GMT
Vary: *
access-control-allow-origin: *
Date: Mon, 01 Jun 2015 11:08:15 GMT
Content-Length: 743


nginx respone in 1.6.:
Server: nginx
Date: Mon, 01 Jun 2015 11:20:59 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 728
Connection: keep-alive
Cache-Control: public, max-age=60
Content-MD5: aMGk4M7K6qzjnOIvVfy6fg==
Expires: Mon, 01 Jun 2015 11:21:48 GMT
Last-Modified: Mon, 01 Jun 2015 11:20:48 GMT
Vary: *
access-control-allow-origin: *
X-Node: cache.example.com
X-Cached: HIT
200 OK

nginx response in 1.8.:
Server: nginx
Date: Mon, 01 Jun 2015 11:23:41 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 728
Connection: keep-alive
Cache-Control: public, max-age=56
Content-MD5: aMGk4M7K6qzjnOIvVfy6fg==
Expires: Mon, 01 Jun 2015 11:24:38 GMT
Last-Modified: Mon, 01 Jun 2015 11:23:38 GMT
Vary: *
access-control-allow-origin: *
X-Node: cache.example.com
X-Cached: MISS
200 OK

2nd nginx response in 1.8.:
Server: nginx
Date: Mon, 01 Jun 2015 11:24:53 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 728
Connection: keep-alive
Cache-Control: public, max-age=57
Content-MD5: aMGk4M7K6qzjnOIvVfy6fg==
Expires: Mon, 01 Jun 2015 11:25:50 GMT
Last-Modified: Mon, 01 Jun 2015 11:24:50 GMT
Vary: *
access-control-allow-origin: *
X-Node: cache.example.com
X-Cached: MISS
200 OK



#file nginx.conf:

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
add_header X-Node $hostname;
add_header X-Cached $upstream_cache_status;

# changed to fake IPs
resolver 1.2.3.4 1.2.3.5;

log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

server_tokens off;
sendfile on;
keepalive_timeout 10s;
tcp_nopush on;
tcp_nodelay on;

proxy_temp_path /srv/www/temp;

proxy_connect_timeout 10s;
proxy_send_timeout 20s;
proxy_read_timeout 20s;
send_timeout 30s;

charset utf-8;
charset_types application/javascript text/css application/atom+xml;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
...
}

#file foobar.example.com.conf:

upstream foobar-origins {
server lb.foobar.example.com;
}

proxy_cache_path /srv/www/cache/foobar.example.com levels=1:2
keys_zone=foobar:10m inactive=2d max_size=1g;

server {
listen 1.1.104.140:80;
server_name foobar.example.com;

access_log /srv/www/log/foobar.example.com/access.log combined;
error_log /srv/www/log/foobar.example.com/error.log;
access_log /srv/www/log/foobar.example.com/pcache.log pcache_json
buffer=16k;

set $volume_key "foobar";
access_log /srv/www/log/global_pcache_volume.log volume-key;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_cache_key "$scheme$host$request_uri";

proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;

location / {
proxy_cache foobar;
proxy_cache_valid 200 206 301 302 5m;
proxy_cache_valid any 10s;
proxy_cache_lock on;
proxy_cache_use_stale error timeout invalid_header updating http_500
http_502 http_503 http_504 http_403 http_404;
proxy_pass http://foobar-origins;
}
...
}


Any hints?

Yours
René

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Viewing all 7229 articles
Browse latest View live


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