Nginx ("engine x") is a lightweight, high-performance HTTP server, reverse proxy, TCP stream proxy and mail proxy, released under a BSD-like license.

learn more… | top users | synonyms

2
votes
1answer
1k views

405 Method even when posting to a php file

I been googling, and all I can find is that this error may happen when you post to an html file. In my setup I have a rewrite rule, that basically hides the index.php from the url, and I for the ...
4
votes
3answers
3k views

Redirect http://mydomain.com:12345 to https://mydomain.com:12345 in nginx

I know this must have been answered already, but I have been searching for quite a while, and cannot find the answer. Just not looking in the right place I guess, maybe someone can help me out. ...
2
votes
1answer
5k views

nginx server_name based on $hostname

Based on the nginx wiki the $hostname variable is "Set to the machine's hostname as returned by gethostname ". I tried that and although gethostname doesn't work my debian box it still returns the ...
0
votes
1answer
1k views

Setting up Passenger + Nginx on Arch

I'm trying to setup passenger and nginx on Arch, but I can't seem to get the nginx server to even start. I've followed the guide found here: https://wiki.archlinux.org/index.php/Nginx#...
4
votes
1answer
2k views

Is it possible to see active connections in nginx?

Is it possible to see what URLs are actively being served by nginx (i.e., see the URLs that are in the middle of being responded to, not the ones that nginx has finished responding to). I would like ...
0
votes
1answer
1k views

proxying ip from nginx to jetty/gwt

Good morning! I have nginx setup in front of jetty 6, which is running a GWT application. I am trying to forward the ip address, and all the answers I find on the internet tell me to do this: ...
3
votes
2answers
728 views

Is there a programmatic interface to nginx configuration?

I am using nginx as a load balancer in front of my web server instances. I run 4 instances of the web server and spread the traffic equally across them using nginx. When I am deploying new version - I ...
2
votes
3answers
760 views

Can advanced web servers be faster than basic web servers?

A bsic web server such as python SimpleHTTPServer or THTTPD reads static files with least process; thus is quite fast. Normally, adding more features to create an advanced web server (but still ...
0
votes
1answer
985 views

Incorrect Django redirect from nginx/Apache HTTPS proxy misconfiguration

I'm fairly new to web development, so I know I'm making a beginner mistake with my server configuration. I have an nginx server sitting in front of an Apache server that is serving Django requests. I ...
0
votes
1answer
1k views

ubuntu server upgrade nginx to 1.1.5 from 1.0.10

I originally installed nginx like: apt-get install python-software-properties add-apt-repository ppa:nginx/stable apt-get update && apt-get --yes upgrade apt-get install nginx and I wanted ...
0
votes
1answer
1k views

nginx perl not working

I have NGINX working happily with PHP FPM all tickety-boo. I am trying to add some Perl pages. I have this in my default site config; location ~ \.pl$ { gzip off; include ...
1
vote
1answer
417 views

Apache and Nginx - Forwarding .htaccess requests to Apache?

A really simple one but it's alluding me entirely. I've set up nginx as a proxy for Apache and at the moment it's only set to allow requests for certain files through to Apache, the config line is ...
0
votes
1answer
1k views

Upstart output pre-start script content

Based on the content of the Ubuntu init.d script to control nginx instances, found at : http://wiki.nginx.org/Nginx-init-ubuntu I'm trying to update Upstart version, found at: http://wiki.nginx.org/...
0
votes
2answers
69 views

Correct sbin-path during nginx rebuild

When I rebuilding nginx I am running these commands ./configure --add-module=$HOME/nginx_mod_h264_streaming-2.2.7 --sbin-path=/usr/local/sbin --with-debug make sudo make install Should the --sbin-...
2
votes
2answers
5k views

Ubuntu + Nginx 127.0.0.1 works but localhost doesn't

this one is weird, because I don't have any error messages. I have a very basic default file: server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 ...
0
votes
1answer
400 views

should I activate keepalive in resin/tomcat ? (with nginx/apache)

I'm using resin(tomcat) back in nginx(apache) parse JSP file only,like this: location ~ \.jsp { // 88 is resin(tomcat) port proxy_pass http://localhost:88; }...
2
votes
1answer
884 views

Nginx forwarding requests to the wrong Apache/Plesk Virtual Host

server { listen 81; server_name example.com localhost direct1.example.com www.example.com admin.example.com forum.example.com; location /media/ { root /var/www/vhosts/...
2
votes
2answers
3k views

How to do this Nginx location configuration

I currently have location /folder1 { configuration goes here } location /folder2 { configuration goes here } I want to serve .mp4 files ...
1
vote
3answers
362 views

Will using HAProxy to load balance provide a failover effect

I currently have a site running on an Nginx platform with PHP-FPM and APC. It is performing very well with the tests I have been trying. I would now like to add failover functionality and can't ...
1
vote
1answer
4k views

ubuntu: Installed php-mcrypt but it doesn't show up in phpinfo()

A web app I'm trying to install on my ubuntu 10.04 LTS requires mcrypt, and is generating this error: Fatal error: Call to undefined function mcrypt_module_open(). I know this is the same question as ...
6
votes
2answers
13k views

Using nginx to rewrite urls inside outgoing responses

We have a customer with a site running on Apache. Recently the site has been seeing increased load and as a stop gap we want to shift all the static content on the site to a cookieless domains, e.g. ...
1
vote
1answer
558 views

nginx host server log rotation all sites

I have setup individual log files for each of my sites in the directory /var/log/nginx-hosts/ and I have to configure log rotation for those files. The base I am starting with is /var/log/nginx-...
2
votes
2answers
800 views

DoS attack requesting single file on server, best way to overcome?

My server's currently being pounded by a large DoS, had to move away from Apache and push everything onto Nginx (rewrites are a nightmare!). Sample from the access log: 186.92.86.149 - - [30/Nov/...
5
votes
2answers
7k views

“ImportError: No module named flask” - Trouble with nginx + uWSGI + Flask in a virtualenv setup

I got nginx + uWSGI running on localhost inside a virtualenv with a simple hello world program, but I get this error when I replace the hello world with a simple Flask app: File "./...
0
votes
1answer
2k views

Installing mp4 mod for nginx

I already have nginx installed on my server but I wanted to add the mp4 located at http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Nginx-Version2. If run these commands in my nginx directory ./...
1
vote
1answer
1k views

NGinx vs Varnish as a reverse proxy in front of Apache w/php [closed]

I am using apache with mod_php to serve content. Mostly the content is fetched form memcache over the network. All of my images, css and js are already on a cdn What are the pros and cons of putting ...
2
votes
3answers
3k views

Ruby on Rails Process Stuck at 100% CPU

Environment: Ubuntu 10.04 LTS, Passenger, Nginx 1.0.6, MySQL, Ruby 1.9.2, Rails 3.1 After some amount of time, the server ends up with a gradually increasing number of processes that are stuck at 100%...
2
votes
1answer
816 views

250k connections for comet with node.js

How to implement node.js to be able to handle 250k connections as comet server (client side we use socket.io)? Would the use of nginx as proxy/loadbalancer be the right solution? Or will HA-Proxy be ...
1
vote
0answers
208 views

Large scale custom domain support for a hosted web service

I am running a hosted platform for publishing Markdown documents. Currently I offer a subdomain per user, but the number one request right now is custom domains. My server stack is NGINX and uWSGI ...
2
votes
1answer
484 views

Separating MySQL Server from Web Server

Hello ServerFault Community, I'm usually a StackOverflow lurker/contributor, however I've been playing with a server cloud service recently and would appreciate your thoughts. I build web ...
0
votes
1answer
213 views

nginx ssl redirect

I have SSL-sertificate for www. mydomain.com How is the right config for nginx to get desired: SSL request without www (https://mydomain.com/somefile) will be redirected to https://www. mydomain.com/...
1
vote
1answer
257 views

NGINX server_name issues

I have the following simple server block on NGINX: server { listen 80; listen 8090; server_name domain.com; autoindex on; root /home/docroot; ...
0
votes
1answer
257 views

Mono fast cgi not working on nginx

I installed mono fast cgi for nginx following instructions on: http://www.mono-project.com/FastCGI_Nginx but when i try to load test aspx file i getting 502 error gateway,and following error in error ...
2
votes
1answer
901 views

NGINX - Two different rails apps under same domain

I have two different Rails (passenger) apps that I wan to host on one server: somehost.com/ <-- App #1 somehost.com/admin <--- App #2 Tried playing with the 'location' directive, but ...
0
votes
1answer
1k views

Chroot jail of Nginx and php

I'm hosting multiple websites on one VPS, and want to chroot each website, eg. /chroot/website1 /chroot/website2 I'm using makejail, which is a highlevel tool, for creating the jails, and copying the ...
0
votes
3answers
329 views

nginx rewrite for wikkawiki

Just setup WikkaWiki on my server, I have been trying to have the links go from wiki.mysite.info/wikka.php?wakka=Start into wiki.mysite.info/DotMG. I tried following their guide at http://docs....
3
votes
2answers
9k views

Nginx: Rewrite from base domain to a sub directory

I have a blog hosted at http://site.com/blog. How do I instruct nginx to rewrite requests from site.com to site.com/blog? This should not be permanent.
1
vote
1answer
578 views

Linode Debian + rvm + nginx + Unicorn kills master at boot or doesn't start unicorn

I'm a new Linode/Linux user running Debian 6. I'm trying to get my Unicorn server to start at boot, but for some reason it is not, and I'm not able to track down any error message. Nginx is starting ...
5
votes
1answer
3k views

Does nginx auth_basic work over HTTPS?

I've been trying to setup a password protected directory in a SSL website as follows: /etc/nginx/sites-available/default server { listen 443: ssl on; ssl_certificate /usr/certs/server....
3
votes
1answer
1k views

Nginx PHP-FPM Basic Auth

I have nginx with php-fpm installed on Debian Squeeze. Directory tree is: /var/www/mysite index.php secret_folder_1 admin.php static.html secret_folder_2 admin.php static.html pictures img01....
0
votes
1answer
188 views

NGiNX + PHP5-fpm + CDN Tools (plugin)

I am trying to activate the CDN tools plugin and I keep getting the following error: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 30720 bytes) in /srv/www/www....
2
votes
1answer
2k views

Symfony2 app in subdirectory nginx

I'm trying to setup a symfony2 app in a subdirectory of our Server Webserver: nginx 1.1.6 + php fpm OS: gentoo my target is to get the app working from a subdirectory subdomain.xy.domain.tld/tool ...
1
vote
2answers
230 views

nginx remove if statements

I am looking for a little advice here for a nginx noob. I have been reading that if statements are way slow in nginx so I was hoping for a little help in converting these. I have tried a bunch of ...
2
votes
1answer
3k views

nginx proxypath https redirect fails without trailing slash

I'm trying to setup Nginx to forward requests to several backend services using proxy_pass. The links on the pages that lack trailing slashes do have https:// in front, but get redirected to a http ...
14
votes
2answers
3k views

How do I configure nginx to accept gzip requests?

I know that you can use nginx HttpGzipModule to gzip responses. Can you als use it to enable nginx to handle gzip-compressed requests, i.e. ones with the request header: Content-Encoding: gzip ? Note:...
4
votes
3answers
8k views

Howto Nginx + git-http-backend + fcgiwrap (Debian Squeeze)

I am trying to setup git-http-backend with Nginx but after 24 hours wasting time and reading everything I could I think this config should work but doesn't. server { listen 80; server_name ...
1
vote
3answers
230 views

Tell nginx to SSL encrypt specific PHP documents

I have set up my server with the following settings: server { server_name www.example.com listen 443; listen 80; location /login\.php { rewrite ^(.*) https://www.example.com/login....
3
votes
1answer
1k views

How to add a new website to a fastcgi-mono-server4 process on nginx without having to restart existing websites?

I know this might be related but I have a script that loads fastcgi-mono-server for defined websites on a configuration file and I need to a new website to the pool without having to reload all ...
2
votes
1answer
4k views

How do I configure nginx to serve PDF files? [closed]

I am starting with a default installation of nginx. The only modification I've made to my enabled-sites/default file is: root /home/ubuntu/www ...where I have a web site and a /pdf folder that ...
2
votes
1answer
5k views

Nginx + uWSGI + Django performance stuck on 100rq/s

I have configured Nginx with uWSGI and Django on CentOS 6 x64 (3.06GHz i3 540, 4GB), which should easily handle 2500 rq/s but when I run ab test ( ab -n 1000 -c 100 ) performance stops at 92 - 100 rq/...