nginx (pronounced "engine-x") is a lightweight, high-performance Web server and reverse proxy as well as IMAP/POP3 proxy server.

learn more… | top users | synonyms

10
votes
5answers
11k views

Why are my PHP files downloading instead of processing with Nginx

I have seen the same problem, and many resolutions for it pointing to adding the type handler, but that was for Apache. I am using Arch Linux, Nginx, PHP and PHP-FMP and I cannot figure out why php ...
0
votes
0answers
17 views

High Mysql Connections

Having a challenge discovering why results are as they are. Perhaps missing something obvious. Sorry this isn't very specific. But if anyone has an pointers on areas to focus on that would be very ...
0
votes
1answer
12 views

Nginx reverse proxy with same config working in 2 situations and not in 1

I have few vps machines with private networking. I'm using nginx in all of them to proxy pass pass requests into fourth machine (10.129.xxx.xxx) which is only listens private connections. I just ...
3
votes
1answer
1k views

How do I get Nginx to pass authentication on to IIS as a reverse proxy?

I have the following setup in my Nginx (1.2.6 on Windows 7) conf file: location ~ ^/FOO/(.*)$ { proxy_pass http://server_two:8888/FOO/$1; } On server_two I have IIS7 running a WCF service ...
1
vote
2answers
1k views

GitLab & nginx: 502

I've installed GitLab, following the given official instruction, but I'm getting 502 error when trying to use it. Nginx log entry: *30 upstream prematurely closed connection while reading response ...
0
votes
0answers
12 views

starting nginx on mac fails with 48: address already in use

I'm trying to start nginx on my Mac OS X using the command sudo nginx It fails with the following error nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use) nginx: [emerg] ...
0
votes
2answers
2k views

nginx rewrite rule to convert URL segments to query string parameters

I'm setting up an nginx server for the first time, and having some trouble getting the rewrite rules right for nginx. The Apache rules we used were: See if it's a real file or directory, if so, ...
4
votes
4answers
3k views

How to use ssl_verify_client=ON on one virtual server and ssl_verify_client=OFF on another?

I want to force ssl client verification for on of my virtual hosts. But get "No required SSL certificate was sent" error, trying to GET something from it. Here are my test configs: # defaults ...
1
vote
1answer
891 views

redmine gives 404 error after installation

I am using Debian squeeze with nginx and mysql. After raking db and loading default data to redmine. When i try to visit redmine in a browser, http://ipaddress:8080/redmine, I get a 404 error Page ...
0
votes
1answer
14 views

Nginx load balancer and Tomcat startup delay

I am using nginx (free version on centos) as a reverse proxying load balancer to a cluster of Tomcat 7 servers. It works great except for the time when tomcat is starting. If a Tomcat instance is ...
0
votes
0answers
6 views

Virtual Host Redirects and Packet Flow [migrated]

If I set up a virtual host in nginx, will all packets flow through that PC? Here is what is going on. I have an openwrt NAT router with two devices behind it, a server and a raspberry pi. I want both ...
0
votes
3answers
647 views

Nginx proxy pass and url rewriting

How to trig this rule only when I have parameters in url, otherwise I will match on an alias. location ~^/static/photos/.* { rewrite ^/static/photos/(.*)$ /DynamicPhotoQualitySwitch/photos/$1 ...
0
votes
0answers
9 views

nginx + php-fpm + v8js crashing

I have a problem concerning v8js extension for php. I needed to install it on my server (and did) (CentOS 6.5, Nginx 1.0.15, php 5.5.12) but whenever I give such a simple test to it: ...
19
votes
1answer
26k views

How to reduce number of sockets in TIME_WAIT?

Ubuntu Server 10.04.1 x86 I've got a machine with a FCGI HTTP service behind nginx, that serves a lot of small HTTP requests to a lot of different clients. (About 230 requests per second in the peak ...
0
votes
0answers
28 views

Nginx server goes down when php file is executed in command line

We have a production nginx web server with php FPM. We ran a php script which updates a particular field in mysql database and mails some content using php mail function. This php script was executed ...
0
votes
3answers
21 views

nginx rewrite location not found

in Nginx config file, did set rewrite location like below but do not work and every time return 404 not found, what is the problem here? server { listen 80; server_name mydomain.com ...
0
votes
1answer
18 views

Howto rewrite URLs with two nginx as reverse proxies to gunicorn/Django

I have a Django application, deployed with gunicorn on port 8000, on a VM with a backend nginx, port 80, on the same VM. The nginx config is: location / { proxy_http_version 1.1; ...
0
votes
1answer
32 views

Reverse-proxied nginx exposing port number when redirecting directory index requests

I have nginx backend that's used to serve static files. Nginx is running on a non-standard port (e.g. 8080). It is publicly accessible via a reverse proxy on port 80. The setup works fine for the ...
-1
votes
1answer
20 views

pagespeed on apache with nginx as reverse proxy

I have a VPS and using the following stack: NGINX as front-end proxy on port 80. Also port 443 for SSL Apache on 8080 for dynamic content (mostly PHP) Now, I want to use PageSpeed module by Google. ...
0
votes
1answer
1k views

Rails 3 passenger nginx application spawner server error on Synology NAS

Question updated, please read UPD2. I'm trying to deploy app through passenger nginx module on DS710+ (ruby 1.9.2p0 installed). There is syntax error relative to ...
2
votes
2answers
241 views

nginx gzip_static: why are the non-compressed files required?

I'm working with nginx 1.4.4 running on Ubuntu 12.04.4. nginx is reverse-proxing a cluster of Rails application servers. Static files (mostly assets) are served directly, without hitting the ...
1
vote
3answers
2k views

Rails + Nginx + Unicorn multiple apps

I get the server where is currently installed two apps and i need to add another one, here is my configs. nginx.conf user www-data www-data; worker_processes 4; pid /var/run/nginx.pid; events { ...
1
vote
0answers
14 views

File descriptor limit in nginx/Passenger app

We're running a Rails app in Passenger 4.0.45 and nginx 1.6.0 (installed by Passenger installer) running on Ubuntu 14.04. Under heavy load Passenger restarts all of the application processes. After ...
0
votes
0answers
22 views

Can't access the DELETE method on nginx

I have run into a strange issue with my server setup. I have nginx installed with php-fastcgi and MySQL. I am using Slim Framework for running my website. For some reason, the DELETE method does not ...
-1
votes
1answer
14 views

nginx rate limitinf unknown directive

I'm trying to set up a rate limit for bots using my website, but if i add limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; or anything of the sort to /etc/nginx/nginx.conf in the http ...
1
vote
1answer
658 views

Configure nginx for multiple node.js apps with own domains

I have a node webapp up and running with my nginx on debian squeeze. Now I want to add another one with an own domain but when I do so, only the first app is served and even if I go to the second ...
0
votes
3answers
26 views

How to remove hypen (-) using nginx rewrite rule?

I am using this rewrite rule to redirect example.com/a-b-c?id=learn-more ----> http://example.com/abc?id=learnmore rewrite ^/a-b-c?id=learn-More http://example.com/abc?id=learnMore permanent But ...
4
votes
1answer
1k views

nginx proxy + ssl +clr “400 bad request” error

Here's the situation - there's a trasnparent nginx proxy that handles SSL certificates and does it well until we decide to add a revocation list management, required for security reasons. This is when ...
1
vote
2answers
25 views

Increase PHP-FPM's max upload/post size

I'm running php5-fpm under Nginx on Ubuntu 14.04. I want to increase the max upload size. I have edited my /etc/php5/fpm/php.ini to have the following lines defined as below: upload_max_filesize = ...
0
votes
1answer
18 views

Nginx, charset directive not working when sending 301 redirect

I have set the charset to 'utf-8' in the nginx.conf file under the http directive. It looks like this: http { charset utf-8; } I have two server directives. One for example.com, and one for ...
0
votes
1answer
1k views

Questions about NGINX limit_req_zone

I got a problem with NGINX limit_req_zone. Anyone can help? The problem is that, I want to limit user access to some specific URL, for example: /forum.php?mod=forumdisplay? ...
1
vote
1answer
16 views

Nginx HTML content while redirect

When the redirection is configured in nginx, the response contains: <html>[CRLF] <head><title>301 Moved Permanently</title></head>[CRLF] <body ...
0
votes
2answers
1k views

NGINX 301 and 302 serving small nginx document body. Any way to remove this behaviour?

We have noticed that when using nginx internal 301 and 302 handling, nginx will serve a small document body with the appropriate Location: ... header. Something along the lines of (in html): 301 ...
2
votes
1answer
42 views

How do I get an Nginx non root ( “/” ) location to serve files?

I'm a Nginx beginner. I rented a little VPS with Ubuntu 12.04 to test. I rented no domain so I make requests directly using the ip. For this question let's assume the ip is 209.208.26.89. Installed ...
0
votes
1answer
22 views

Restricting multiple directories to same IP ranges

Suppose I have the following in an nginx configuration file: location ^~ /foo/ { allow 1.2.3.4; allow 5.6.7.8; allow 9.10.11.12; … allow 99.100.101.102; deny all; # rest ...
0
votes
0answers
13 views

nginx and expire header not working

this is my nginx config location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 1y; add_header Pragma public; add_header Cache-Control "public"; try_files $uri $uri/ /$1/$2 =404; ...
0
votes
0answers
14 views

Wordpress PHP half works on nginx

under the path there are public files: $/usr/share/nginx/html 50x.html readme.html wp-content wp-mail.php apc.php wp-activate.php wp-cron.php wp-settings.php ...
1
vote
0answers
16 views

nginx add_header is not working

I'm using nginx-1.7.0 on windows 7. I am trying to use add_header to get to a json file I have residing in /data/TESTFOLDER. This is what my location block looks like: location ...
0
votes
1answer
36 views
+100

Update Cache-Control max-age when srcache returns response from cache

I have configured Nginx to use srcache (along with the redis and redis2 modules). Server-side caching works great. My application responds with the appropriate Expires and Cache-Control headers, and ...
0
votes
0answers
17 views

In NGiNX my try_files is trying to get a php file in the wrong place

Here is a sample of my configs: root /usr/local/html/website/public/; location ~* auth/v1/* { try_files /auth.php?$args $uri/; } # location = /auth {return 301 ...
3
votes
2answers
958 views

Nginx index.php forbidden sub-directory only!

I'm using nginx 1.0.4 + php-fpm + wordpress on OpenVZ Container. my setup works fine. but when i try access to http://example.com/wp-admin/ it give me 403 error and I access ...
0
votes
2answers
821 views

504 error in nginx +php-fpm : post request

I have a test server with nginx and php-fpm. Pages on the site are opening correctly, but when I want send POST request for example an "authorize on site" I get "504 Gateway Time-out error". Nginx ...
0
votes
0answers
30 views

Nginx error: “File not found”…coming from someone else's domain

I set up nginx to serve from an Ubuntu EC2 instance a few days ago, and today I checked the error logs when I encountered 504 after 504 in the browser. I found the following in my error.log: ... ...
1
vote
2answers
75 views

Nginx, proxy_pass, mangled relative links upstream

I'm having a problem with nginx proxy_pass and have pored over the HttpProxyModule documentation at the nginx wiki, but can't figure it out. I have Supervisor (http://supervisord.org/) running on a ...
0
votes
2answers
647 views

NGINX location clause for only root domain

How do I only redirect too sub1.example.com when hitting $request_filename ~ /sub1 on example.com. For example if I'm on sub1.example.com, hitting /sub1 wont redirect me back too sub1.example.com but ...
0
votes
5answers
2k views

nginx: php-fastcgi running but php files not executing

I have recently set up a nginx server with PHP running as FastCGI process. The server is running with HTML files however PHP files are downloading instead of displaying and PHP code is not processed. ...
0
votes
0answers
10 views

Nginx/PHP-FPM: Returning 404s for CSS and JS

I can't access PHP files placed in sub-directories and my CSS/JS files return a 404 in browser. Yes, I have seen many others experiencing a 404 issue but their fixes don't seem to be my solution. I've ...
4
votes
3answers
7k views

How to install nginx and install the configuration files too

I've just completely uninstalled nginx 1.0.6 from my server (Ubuntu 11.04) using apt-get remove nginx rm -rf /etc/nginx/ rm -rf /usr/sbin/nginx rm /usr/share/man/man1/nginx.1.gz apt-get remove ...
0
votes
2answers
147 views

Nginx PHP-fpm permission

When i'm setting the user in nginx.conf to root root: user root root; then my website is working, but when i set it to nginx nginx i get error in the logs: connect() to ...
2
votes
1answer
17 views

Nginx throws 404 only on php scripts using php-fpm

I've installed a testing server using nginx + php-fpm. I've tried all of the following: Nginx + Php5-fpm not rendering php files nginx + php fpm -> 404 php pages - file not found When accessing ...