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

Nginx + PHP Windows Network Sharing Uploads locking/slow load time (6 replies)

$
0
0
So i have Nginx as a web server with PHP running as fastcgi what nginx serves traffic via upstreams.

The strange bug i have encountered is the fact when i upload a large file lets say 2GB and PHP must pass this file to a mapped hard drive via network sharing. PHP/Nginx does not serve traffic to anyone until that temp(uploaded file) has been successfully moved to the mapped hard drive.

Does anyone know why it would be locking up like this or how to solve it ? I don't think it is Nginx i think it is just PHP that is locking up. But it is a nightmare trying to figure out how to keep it serving traffic since there will be 60-120 seconds while PHP is pushing this file to the mapped hard drive that no traffic gets served and everyones pages keep loading (they don't time out just keep loading / waiting for first byte what is always sent as soon as the file upload is complete.)

If it helps its latest php builds default production config and itpp2012's Nginx Build.

[ANN] Windows nginx 1.9.3.1 Lizard (4 replies)

$
0
0
18:54 10-7-2015 nginx 1.9.3.1 Lizard

Based on nginx 1.9.3 (10-7-2015) with;
+ Openssl-1.0.1p (CVE-2015-1793)
+ nginx-module-vts (new fix for 32bit total overflow counters)
+ Array-var-nginx-module v0.04 (upgraded 29-6-2015)
+ echo-nginx-module v0.58 (upgraded 29-6-2015)
+ encrypted-session-nginx-module v0.04 (upgraded 29-6-2015)
+ headers-more-nginx-module v0.26 (upgraded 29-6-2015)
+ lua-nginx-module v0.9.16 (upgraded 29-6-2015)
+ set-misc-nginx-module v0.29 (upgraded 29-6-2015)
+ pcre-8.37b-r1573 (upgraded 29-6-2015, more overflow fixes)
+ Source changes back ported
+ Source changes add-on's back ported
+ Changes for nginx_basic: Source changes back ported
* Scheduled release: yes
* Additional specifications: see 'Feature list'

Builds can be found here:
http://nginx-win.ecsds.eu/
Follow releases https://twitter.com/nginx4Windows

NGINX plus REST monitoring API query (no replies)

$
0
0
HI

I have deployed NGINX plus trial version in my setup. I have a query that
if we use NGINX plus as a load balancer then is there any way to fetch the
relationship between the virtual servers and its attached pool of servers
configured in NGINX through REST monitoring API's?

Thanks and Regards
Subramaniam
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

remote server static content is not getting loaded (1 reply)

$
0
0
Hi,

ISSUE: Static content is not loaded from remote server where application is deployed, rather it is reading from the server where NGinx is installed.
-------------------------------------------------------

Nginx-1.8.0 is installed (on the server nginx.corp.stel.no)

Proxy pass to another server (workspace.corp.stel.no) for an webrequest

Below configurations made:

server {
listen 80;
server_name workspace.corp.stel.no;

location /{
proxy_pass http://stelworkspace/workspace/agentLogin/;
}

location ~* \.(js|jpg|png|css|woff|svg|gif|eot|ttf)$ {
root /var/gvp/Nginx/nginx-1.8.0/ser_static_info;
expires 30d;
}
}

This is reading data from local Nginx server (nginx.corp.test.no) and not from the remote server (workspace.corp.stel.no) where application is deployed

Tried below option too..

location ~"*\.(js|jpg|png|css)$" {
root http://workspace123/workspace/;
expires 30d;
}

Nothing seems working

Pls. assist here? If given an example...would be appreciated


Best regards,
Maddy

Query Rewrite Help (2 replies)

$
0
0
Hi,

Am suffering with a bit of writer's block when it comes to query rewrites.

I've got a rewrite rule that looks like :

rewrite ^/api/app/([^/]+)/([^/]+)/([^/]+)?$ /api/app/$1.php?p=$2&q=$3? last;

I am having two problems :

- I am getting 404 when I try to make a POST call to /api/app/login, I
have to use the full suffix, i.e. api/app/login.php instead.

- I want to make the last ([^/]+) optional, but seem to also be getting
the same 404 if I forget to include it ?

Ideas most welcome, thanks !

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

keepalive_timeout, proxy_send_timeout, and proxy_read_timeout ignored (no replies)

$
0
0
Hi, I'm using AWS Beanstalk with nginx in front of a Puma server serving Ruby on Rails. I have one URL that is for an EventSource so it is kept alive and data is streamed out. I was running into this problem http://forum.nginx.org/read.php?2,237386,237386 where when the client closes the browser but nginx keeps the connection alive forever so I tried having nginx automatically close the connection after 5 seconds. I set keepalive_timeout, proxy_send_timeout, and proxy_read_timeout all to 5 seconds but all were ignored. The connection remained open until nginx was restarted.

# nginx config

upstream my_app {
server unix:///var/run/puma/my_app.sock;
}

server {
listen 80;
server_name _ localhost; # need to listen to localhost for worker tier

if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; }

location /dashboard_stream {
proxy_pass http://my_app; # match the name of upstream directive which is defined above
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_cache off;
proxy_http_version 1.1;
proxy_set_header Connection '';
chunked_transfer_encoding off;
keepalive_timeout 5s;
proxy_send_timeout 5s;
proxy_read_timeout 5s;
}
}

# nginx version
nginx version: nginx/1.6.2

# AWS linux version
NAME="Amazon Linux AMI"
VERSION="2015.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2015.03"
PRETTY_NAME="Amazon Linux AMI 2015.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2015.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2015.03

# kernel version
Linux ip-172-31-12-138 3.14.42-31.38.amzn1.x86_64 #1 SMP Wed May 13 20:33:05 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

New to nginx question about php-fpm (2 replies)

$
0
0
I am new to nginx and had a question about php-fpm.

It seems that php-fpm is being restarted at random times. I am not sure what is causing the restart, but when it does I am getting this in the php-fpm.log

[12-Jul-2015 00:52:29] ERROR: An another FPM instance seems to already listen on /opt/pifpm/fpmsockets/5.5.11.sock
[12-Jul-2015 00:52:29] ERROR: FPM initialization failed

I am assuming that the error is happening because the FPM processes are not being shut down correctly?

I am not sure how to find what is calling the FPM restart. Do you have any suggestions on how to find the initial restart call and how I can make it restart smoothly?

The server is a centos server with cpanel. I have not been able to locate the php-fpm.conf or the nginx.conf on my server.

I know you need more info than this, so please point me in the right direction.

Nginx Magento multistore configuration (1 reply)

$
0
0
There is a website that has multiple subcatogories which are stores in magento:

www.website.com/sub1 www.website.com/sub2 www.website.com/sub3

The server used is ngnix. everything is set up. And used to work, the nginx conf file for this site need to be reconstructed.

at the moment when for example www.website.com/sub1 is requested this wil set the store to store to sub1. which works fine. However when a product is asked i.e. www.website.com/sub1/product this returned a "page not found" error.

If the store is set to sub1 the url www.website.com/product DOES FIND the product without any issues. on the other hand f the store was not set previously, www.website.com/product DID NOT FIND the product.

it seemed that once a store is set the following happens e.g. www.website.com/sub1/product :

sub1->sub1->product == error (because of sub1->sub1)

this should be:

sub1->product.

note that setting the store when www.website.com/sub1/product is requested and then redirecting the site to www.website.com/product is not an option. everything used to work fine! The store setup had not been changed. only the the nginx conf file should be adjusted. any sugestions?

to be more specific: in the root folder there is an index.php file were magento is set to run the website via mage run code. In the root folder there are subfolders one for each store. these folders each contain an index.php file were the store is set. any more info needed?

Any help would be appreciated.

additional info: in the root folder there is an index.php file were magento is set to run the website via mage run code. In the root folder there are subfolders: one for each store. These folders each contain an index.php file were the store is set( again via mage run code) (the stores are being set correctly in these files).

the nginx conf looked like this:




server {

listen 80 default;
server_name website.com;
root /www_folder;
client_max_body_size 10M;

location / {
index index.php;
try_files $uri $uri/ @handler;
expires 30d;
}


location /mage/ {
try_files $uri $uri/ @magehandler;
expires 30d;
}

location @handler {
## Remove trailing slash
rewrite ^/(.*)/$ /$1 permanent;
## Magento uses a common front handler
rewrite / /index.php;
}

location @magehandler {
## Adds a trailing slash to any urls that is missing a trailing slash
rewrite ^(.*[^/])$ $1/ permanent;
## Magento uses a common front handler
rewrite /mage/ /mage/index.php;
}


## These locations would be hidden by .htaccess normally, protected
location ~ (/mage/(app/|includes/|lib/|pkginfo/|var/|errors/local.xml|shell/|tmp/|cron.+)|/\.git/|/\.ht.+)
{deny all;}

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

location /. { ## Disable .htaccess and other hidden files
return 404;
}

location ~ .php/ {
rewrite ^(.*.php)/ $1 last;
}

location ~ \.php$ {
add_header X-UA-Compatible 'IE=Edge,chrome=1';
try_files $uri =404;
expires off;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_param SERVER_PORT 80;
fastcgi_param HTTPS $fastcgi_https;
}
}

Nginx with Organization PROXY server (3 replies)

$
0
0
Hello ,

on a linux box I define to move the traffic through some Centralize
proxy server ( Organization one )
in order to configure the proxy from the command line I ran :
export HTTP_PROXY="http://<proxy_server>:<proxy port>"

On the same box I have nginx which serve as a reverse proxy and all
the local application sending the traffic through the local reverse
proxy


how can I force the nginx to fwd all the traffic through the ORG proxy server ?

chart ...


Linux Box Proxy
server | Internet |
|--------------------------------------------| =>
|---------------------------| =>
<node.js code > -> < nginx > Organization Proxy
| |


Thanks !

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

Problem Nginx with SSL Settings active in IIS 7.5 (1 reply)

$
0
0
I've got the following problem with nginx working with IIS, when enabled the client certificate in the SSL Settings solicitation IIS, it performs two SSL handshake, a first without requesting the certificate after this first handshake is done another handshake requesting the certificate. The operation is done as explained in this link: http://blogs.technet…ertificate-authentication.aspx
When access the application through the nginx reverse is done only one handshake already requesting the certificate, resulting in no operation of the application.

nginx-1.9.3 (1 reply)

$
0
0
Changes with nginx 1.9.3 14 Jul 2015

*) Change: duplicate "http", "mail", and "stream" blocks are now
disallowed.

*) Feature: connection limiting in the stream module.

*) Feature: data rate limiting in the stream module.

*) Bugfix: the "zone" directive inside the "upstream" block did not work
on Windows.

*) Bugfix: compatibility with LibreSSL in the stream module.
Thanks to Piotr Sikora.

*) Bugfix: in the "--builddir" configure parameter.
Thanks to Piotr Sikora.

*) Bugfix: the "ssl_stapling_file" directive did not work; the bug had
appeared in 1.9.2.
Thanks to Faidon Liambotis and Brandon Black.

*) Bugfix: a segmentation fault might occur in a worker process if the
"ssl_stapling" directive was used; the bug had appeared in 1.9.2.
Thanks to Matthew Baldwin.


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

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

nginx for Postgres servers (2 replies)

$
0
0
I know nginx is designed to handle web and mail servers. Does it make sense to use to handle multiple (in our case 2) PostgreSQL database servers?

Tom Ekberg
Senior Computer Specialist, Lab Medicine
University of Washington Medical Center
1959 NE Pacific St, MS 357110
Seattle WA 98195
work: (206) 598-8544
email: tekberg@uw.edu


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

Storing $server_addr in a variable VS using it directly in location block (no replies)

$
0
0
According to the documentation getting the value of $server_addr to set a response header makes a system call, and can impact performance negativelyset $ip $server_addr;

server {
location /health {
add_header Backend $server_addr;
return 200;
}
}

Would the following be a better solution, and eliminate the system call on every request?

server {
set $ip $server_addr;

location /health {
add_header Backend $ip always;
return 200;
}
}

nginx_status (no replies)

$
0
0
Hi Team,
I am configured to use nginx_status and I can see the expected result on the browser

Now, the query is: the /nginx_status configuration is done on the server block. Is this required to be repeated for every server block exists in the nginx.conf file? Or any feasibility to set globally for all the servers.

Pls. update

Regards,
Maddy

Health Monitoring (2 replies)

$
0
0
What is the best way to perform health check of Nginx server?

Backup Nginx server is recommended, in case of risks with Primary Nginx server?

Problem with nginx + uwsgi (no replies)

$
0
0
Hi everybody,

I'm having a problem with my nginx and uwsgi. I don't really know what
I'm doing wrong.

Here is the configuration of nginx:

server {
listen 80;

location /api/v1 {
uwsgi_pass unix:///tmp/api.sock;
include uwsgi_params;
}

location / {
return 444;
}

And this is uwsgi configuration:

[uwsgi]
socket = /tmp/api.sock
chdir = /var/www/api
master = true
plugin = python
pp = /home/api/src
file = uwsgi.py
uid = www-data
gid = www-data
threads = 4
workers = 4
callable = app
chmod-socket = 666
post-buffering = 4096
virtualenv = /usr/local/venvs/api
callable = ins
env = API_SETTINGS_FILE=../../etc/settings.py

If I execute following command everything seems to be working fine:

curl -v http://127.0.0.1/api/v1/login

{
"message": "Method Not Allowed",
"status": 405
}

HTTP/405 it's the expected answer since the app doesn't allow login
resquets with GET method, So now I'm going to try with POST.

The application expects for data such as email and password, so this should
trigger a 500 in the api backend

curl http://10.10.10.35/api/v1/login -X POST

uwsgi log:

[pid: 19484|app: 0|req: 5/5] 127.0.0.1 () {30 vars in 340 bytes} [Fri Jul
17 12:05:00 2015] POST /api/v1/login => generated 0 bytes in 432 msecs
(HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)

Everything good but the answer of nginx it's wrong:

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.7.1</center>
</body>
</html>

So for any reason nginx interpret the HTTP/500 from the API as the gateway
it's no available.

Do you see what I'm doing wrong?


More info:

Nginx 1.8.0
Ubuntu 12.04
uWSGI 1.0.3

Thanks in advance
--
-- Guido Accardo --
"... What we know is a drop, what we ignore is the ocean ..." Isaac Newton
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Rewrite rules in nginx config (2 replies)

$
0
0
Hi all,
thank's to accept me in this forum.

I'm a newbie... I have a problem with a rewrite rules that I imported from apache

This is my code


index home.php index.php;
location / {
rewrite ^/(.*)?$ /categories.php?cat=$1;
rewrite ^/(.*).html?$ /game.php?game=$1;
rewrite ^/(.*)/(.*).html?$ /game.php?game=$2 break;
}

location /dists/ {
# Do nothing. nginx will serve files as usual.
}

location /images/ {
# Do nothing. nginx will serve files as usual.
}
location /admin/ {
# Do nothing. nginx will serve files as usual.
}
location /css/ {
# Do nothing. nginx will serve files as usual.
}
location /config/ {
# Do nothing. nginx will serve files as usual.
}

I'd like ti take parameters from cat and game and use them to know the path.
This is oc, but so... all others directories don't work.
Is this configuration so insensitive?

Conditional access log formatting ? (1 reply)

$
0
0
Hi,

I'm using haproxy infront of some NGINX instances, but only for some
instances which are being loadbalanced by haproxy, there are other
instances which go straight through.

I realise I need to change the logging format in NGINX to enable
X-Forwarded-For in the access logs.

The question is whether I can conditionally format the logs, i.e. use
"X-Forwarded-For" if it exists, otherwise use the normal NGINX logging
format.

I've had a quick peek at the manual, I'm thinking maybe this can be done
with a map of some sort ? Maybe there's a better way ? To be honest
I've no idea where to start, and I've never used maps before anyway !

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

[ANN]nginx-access-plus v0.1.0 released! (1 reply)

$
0
0
Nginx-Access-Plus is a Nginx module allows limiting access to certain http request methods and client addresses.

e.g.

location / {
allow_method all get|head;
allow_method 192.168.1.0/24 post|delete;
deny_method all all;
}


website : https://github.com/nginx-clojure/nginx-access-plus

browser downloading html files (no replies)

$
0
0
Hi,
Haven't used nginx in few years and trying to get it into production.

i'm having what will probably be a silly misconfiguration to most. I'm
running nginx
*nginx*-1.8.0-1.el7.ngx.x86_64
CentOS 7
with PHP-fpm

When I hit every PHP link on this site it generates some html and my
browser downloads it. I used the winginx .htaccess converter to create the
rewrite rules.

Any direction would be great

Thanks,
James

Here is my config:

server {

listen 80;

server_name www.imagesite.net *.imagesite.net;

root /var/www/imagesite.net/html;

index index.php;

error_page 404 /404.html;


# redirect server error pages to the static page /50x.html

#

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/share/nginx/html;

}


# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_intercept_errors on;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /var/www/
imagesite.net/html$fastcgi_script_name;

include fastcgi_params;

}


# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

location ~ /\.ht {

deny all;

}


autoindex off;

location / {

autoindex off;

rewrite ^/([^/]*)/([^/]*)/([^/]*)\.html$
/item.php?parentcategorie=$1&categorie=$2&fx=$3 break;

rewrite ^/([^/]*)/$ /cat.php?parentcategorie=$1 break;

rewrite ^/([^/]*)/([^/]*)/$
/subcat.php?parentcategorie=$1&categorie=$2 break;

rewrite ^/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$
/page.php?parentcategorie=$1&categorie=$2&fx=$3&img=$4 break;

try_files $uri $uri/ =404;

}


}
_______________________________________________
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>