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

17
votes
2answers
48k 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
696 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 ...
9
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 - - [19/Dec/...
6
votes
6answers
16k 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.
6
votes
1answer
110 views

Where are these spammy posts generated from?

While doing a a random Google search, I realized that my WordPress blog is populated with several spammy posts. Ex: (intentionally delinked) http://example.com/2016/02/06/free-download-wallpaper-...
5
votes
1answer
786 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 66.6.44....
4
votes
1answer
473 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
83 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
30 views

More Secure NGINX Authentication than auth_basic

I've been trying to come up with the most secure method of authentication to my reverse proxy in NGINX. I've been using ngx_http_auth_basic_module so far without any issues, but there are apparently ...
4
votes
1answer
290 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 www....
4
votes
1answer
196 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
981 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
147 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
288 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
253 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
85 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
371 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
247 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
107 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
110 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
109 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
356 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
501 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
2answers
40 views

When moving a load balanced PHP site from Apache to Nginx, how does the code have to be modified?

When moving to Nginx with multiple php-fpm servers from a more "traditional" Varnish + multiple Apache2 / mod_php setup: Must we expect to rewrite parts of our software? I just discovered that many ...
2
votes
1answer
40 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 ^(/.*\.(css|...
2
votes
1answer
80 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
352 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
479 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
184 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
780 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
59 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
75 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
56 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
102 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 https://$...
2
votes
1answer
70 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
687 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
62 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
154 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
332 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
306 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
35 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 - http://example.com/sitemap....
2
votes
0answers
34 views

sub_filter doesn't work when used with MediaWiki?

I'm working on a site, https://factinfiction.meulie.net/ . This site runs the latest stable version of MediaWiki (1.26.2). In the server-config I have the following location-block: location / { ...
2
votes
0answers
115 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: https://example.com/folder/myfile/xx/...
2
votes
0answers
196 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 ...