nginx (pronounced “engine-x”) is a lightweight, high-performance Web server/reverse proxy and e-mail (IMAP/POP3) proxy, licensed under a BSD-like license.

learn more… | top users | synonyms

14
votes
2answers
45k views

Can I skip the PEM pass phrase question when I restart the webserver?

After buying a multi-domain SSL certificate I have started testing it with the Nginx webserver (following documentation in their SSL wiki page). Everything is fine, it works and I get a green ...
13
votes
5answers
678 views

Is it worth looking into a webserver other than apache?

I've traditionally deployed my sites under apache, simply by default. I've heard things about NGinX though and I'm wondering under which conditions it would be superior. In addition to apache and ...
8
votes
2answers
4k views

Why there suddenly were so many 400 request in my access log?

Below are little part of my access_log 118.186.8.50 - - [19/Dec/2011:22:42:57 +0800] "-" 400 0 "-" "-" 05 118.186.8.50 - - [19/Dec/2011:22:42:57 +0800] "-" 400 0 "-" "-" 06 118.186.8.50 - - ...
5
votes
6answers
15k views

How to block baidu spiders

Most of my visits are from baidu spiders. I don't think it helps search engines at all so I'm thinking of how to block them. Could this be done via iptables? I'm using nginx as my webserver.
5
votes
1answer
763 views

Nginx Reverse Proxy for Tumblr

I'm currently trying to set up a reverse proxy redirecting a domain to a tumblr blog. I've set up NGinx using this Gist. My nginx configuration looks like so: upstream tumblr { server ...
4
votes
1answer
427 views

How can I serve all resources under HTTPS instead of HTTP without changing their URLs in the HTML code

I know that by using an .htaccess file I can redirect everyone to https://. However, my SSL certificate complains if all the content isn't served under HTTPS. Is there a way to convert all the ...
4
votes
1answer
81 views

When I search on my domain name in a browser, the IP address is returned for my site hosted with GoDaddy and NGINX

The IP address of my site is returned when I do domain name search in my browser. I am using: GoDaddy Hosting Nginx Node.js Obviously I would like the domain name and not the IP address, how can ...
4
votes
1answer
283 views

How to make my websites content available as Tor .onion and Clearnet .com?

I'm running a website with Nginx which I would like to be accessible by Tor and by Clearnet. Currently it's only reachable by Clearnet, e.g. www.example.com. Of course people just can go to ...
4
votes
1answer
187 views

Nginx and Google Appengine Reverse Proxy Security

The scenario is that I have a Google compute node running Nginx as a reverse proxy to the google appengine. The appengine is used to service REST calls from an single page application (SPA). HTTPS ...
3
votes
2answers
2k views

What is the default behavior of Cache-Control

If no private nor public were defined in the cache-control, e.g. Cache-Control: max-age=31461276 What is the expected behavior?
3
votes
1answer
961 views

What does the '^' mean in “rewrite ^ http://example.com permanent;”

I found some configuration of nginx contains: if($args ^~ post=140) { rewrite ^ http://example.com/ permanent; } What does the ^ mean in rewrite ^ http://example.com/ permanent?
3
votes
1answer
69 views

Rewriting image URLs in nginx from a shortened URL to a specific directory

I'm using an image serving application on nginx/1.4.6 (Ubuntu), but it was made for Apache2. Images are uploaded to directory "/imageshare/images/extension/" where the filename is randomly generated, ...
3
votes
1answer
280 views

Why do some Nginx configurations block download agents using Wget?

I noticed that some Nginx configurations block download agents using Wget like this: if ($http_user_agent ~* LWP::Simple|wget) { return 403; } Why block Wget? If I use the above code in my ...
3
votes
1answer
14k views

Nginx negating condition/ if else

I've came into situation where I cannot find a way around it, neither with tons googling. valid_referers none blocked something.com; if ($invalid_referer) { rewrite ^ /leech.jpg; expires ...
3
votes
1answer
251 views

Why SPDY-enabled pages are not loading faster?

I've just enabled the SPDY module on nginx, as explanained on the SPDY module site. I expected a speed enhacement on my site, but I haven't noticed it. Using Firefox 25 and Firebug, I tried to take a ...
3
votes
0answers
79 views

Using Nginx to rewrite a friendly URL to index.php handler gives 404 errors

I am having some issues getting the below to work the way I expect. What I am trying to do is take a url like https://example.com/TOPIC/courses/details/143911 but have it sent to php with the ...
2
votes
3answers
289 views

How to block a user-agent that has a spacing in its name?

I got a hit from a crawler with a user-agent called DV CRAWLER which is an abvious a spam-bot. I tried to block it in both .htacess and nginx configuration as I'm running nginx as a reverse proxy in ...
2
votes
2answers
242 views

Google indexed my site through a subdomain, how to fix?

So I recently switched to nginx but I didn't specify my site_name in nginx.conf, which I've learned is interpreted as a wildcard domain, meaning you can access the site through any subdomain. I had a ...
2
votes
1answer
104 views

Setting up Nginx Load Balancing

I'm setting up an Nginx web server and and want to perform load balancing using the round robin method. This is what I have found thus far: upstream backend { server backend1.example.com; ...
2
votes
2answers
109 views

Why do servers need to know their domain?

Besides routing traffic, why do servers need to be configured with the server name? It seems like a waste in all cases except for routing or hosting for a TLD. Nginx example: server { listen 80; ...
2
votes
2answers
98 views

Share a configuration among different “server” directive

I'm trying to share a variable across different "server" blocks, http { set $bad_ua "..."; server { if ($http_user_agent ~ $bad_ua) { ... } } } But nginx says ...
2
votes
2answers
348 views

Is static HTML the fastest?

I have been researching several different techniques to deliver web content fast, like nginx and node.js. When it comes down to performance optimization http expires headers and gzip come to mind. ...
2
votes
1answer
1k views

Vbulletin on nginx?

As an nginx fan, I need to set up a VB for a friend so I am wondering whether one can server VB site using nginx/php-fpm instead of apache? What are the specefic rewrite rules for that? How common ...
2
votes
1answer
500 views

Unlimited free sitemap generator for Nginx? [duplicate]

Possible Duplicate: Looking for a sitemap generator Google has listed a couple of SMGs but I don't want to try every single one to find the best. Google's own Sitemap Generator is released ...
2
votes
1answer
36 views

NGINX Rewriting Question

How would I convert the following Apache rule RewriteRule ^watch/([A-Za-z0-9-]+)/?$ watch.php?v=$1 [NC] into the appropriate format for an NGINX configuration file? Further edit: server { ...
2
votes
1answer
86 views

Nginx Rewrite causing problems

I wrote a little php script that reads and compresses css and javascript files. I used a rewrite to automatically redirect all resources to that script. The rule looks like this: rewrite ...
2
votes
1answer
78 views

NGINX URL Redirect - Configuration

What should be the correct configuration , if i want to redirect any request for www.mydomain.com to www.mydomain.com/page. I tried couple of options but always ended up in an redirect loop.
2
votes
1answer
337 views

How should I set up and use a CDN for my web application?

I plan to create and run my own CDN. Currently, media and other static content is being served by the web-servers which are behind a load balancer which is a waste of resources. The network structure ...
2
votes
2answers
472 views

Why does modx-based site start using different domains for some content?

situation I have a modx site on a VPS with multiple domain and subdomain names. The modx site should use what I call the 'primary' domain name's 'primary' subdomain, ie www.intendedname.tld . The ...
2
votes
1answer
183 views

Permissions & File Structure w/ nginx & multiple sites

I am using nginx for the first time as a long time Apache user. I setup a Linode to test everything and to eventually port over my websites. Previously I had /home/user/www (wwwroot) I am looking ...
2
votes
2answers
773 views

Nginx frontend, Apache backend, and Magento

I've got a Magento installation, which works perfectly from a customer's point of view. However, when you try and do batch tasks with the admin, Nginx often closes the connection to the browser early, ...
2
votes
2answers
26 views

Sitemap compressed is in unsupported format but valid if uncompressed

I've build a sitemap_index pointing to different sitemaps "sitemap1.xml" If they are uncompressed, they are successfully validated and accepted (Google Webmaster). However, when compressed, they are ...
2
votes
2answers
61 views

Using one index file in all directories and subdirectories

I have an index.php file, which processes content of a directory it is located in and renders output to the browser. The problem is that the directory structure it is supposed to serve is rather ...
2
votes
1answer
32 views

How do I ensure that I redirect HTTP requests to HTTPS?

I use CloudFlare for DNS for a variety of sites. I am using all three free Page Rules for custom caching, and I am trying to avoid upgrading to their Pro service to use Page Rules to force HTTPS. I ...
2
votes
1answer
93 views

Redirect http to https with nginx and rewrite a rule gives redirect loop

I want to redirect http to https along with rewrite ^(.*)$ /$1.php; My nginx virtualhost file: server { listen 80; server_name domain.com; return 301 ...
2
votes
1answer
64 views

How do I rewrite URL's for a subdirectory of a site?

I host a mirror of the Textfiles archive, on http://subdomain.example.com/ Part of this mirror is a mirror of pinouts.ru, located on http://subdomain.example.com/mirror/pinouts.ru/ As you can see ...
2
votes
2answers
534 views

Webmin: Cannot login through nginx reverse proxy

I've created a reverse proxy for webmin through nginx to run webmin at [site domain]/webmin instead of port 10000 ([site domain]:10000). When I go to [site domain]/webmin, the login page shows up as ...
2
votes
1answer
61 views

Preventing content from being linked

I am currently running a fairly popular private Wordpress site on a dedicated bare metal server using ISPConfig, Nginx and MariaDB. We have a series of podcasts and content that we host specific for ...
2
votes
1answer
153 views

Optimize TOR website

There is VERY little to find about optimizing a website which runs in the tor network. Besides installing the tor daemon, what can you do? Are there any tricks like -I don't know- connecting it to ...
2
votes
1answer
72 views

Simple RewriteRule [duplicate]

I'm trying to write a RewriteRule to make a simple url. I want users to be able to type enter www.example.com/somepage and have it take them to www.example.com/abc/somepage.php How can this be ...
2
votes
1answer
329 views

Trouble with images in phppgAdmin on my Nginx VPS

this is my first time using Nginx or phppgAdmin, and after placing the phppgadmin folder into my public_html folder I find that the resources for the phppgadmin page are broken, images and css ...
2
votes
1answer
2k views

nginx proxy rewrite not matching

I'm setting Nginx to forward requests to several backend services using proxy_pass A few of them I have to add rewrite rules to strip the folder off, however for this particular service, the rewrite ...
2
votes
1answer
301 views

How to avoid leeching / hotlinking files?

I use Kleeja script to host files and noticed that certain files are downloaded many more times than the site's visit counter indicates. So I assume that the files are being leeched. The web server is ...
2
votes
0answers
23 views

How to make nginx override web app route for sitemap and robots?

I would like to make nginx serve sitemap and robots. My problem is that route http://example.com/ is handled by flask, configured to handle request with certain patterns - ...
2
votes
0answers
92 views

nginx rewrite for an url with parameters

I have two types of URL and want to rewrite it for friendly URL. 1. The first: https://example.com/folder/myfile.php?id=xx&param1=yy I want to rewrite to: ...
2
votes
0answers
159 views

Nginx aliases and proxy_pass

I'm using nginx as web front-end and apache2 as web back-end. Apache runs several websites locally and nginx access them. At the moment, different sub-domains are hosted, but I want to migrate them ...
2
votes
1answer
149 views

Cache an external site that may have a mobile version

In continuation of the answer for the "Nginx Reverse Proxy for Tumblr" question, what is the best way to cache a web-site like Tumblr with nginx, which returns distinct results depending on the ...
2
votes
0answers
196 views

How to filter GET requests with Nginx, keep getting 504 after [GET] “/manager/html”

I was recently unable to reach my website, receiving a 504 time-out error instead. I checked the logs and found a GET request for /manager/html. I realize this was a failed attempt to reach a control ...
1
vote
3answers
318 views

Multi site wordpress setup

Currently my company has 3 blogs and what I did was to install three instances of wordpress over Apache/MySQL, in different directories. The problem is that I have a Slicehost VPS with 256Mb RAM with ...
1
vote
3answers
105 views

Should 301 redirects from www to the naked domain include the path for SEO?

I'm trying to sort out a redirect for my site from www to the "naked" domain. My redirect currently does this: www.example.com -> example.com www.example.com/test.html -> example.com Is this ...