nginx (pronounced "engine-x") is a lightweight, high-performance Web server and reverse proxy as well as IMAP/POP3 proxy server.
99
votes
5answers
68k views
In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?
I want to rewrite all http requests on my web server to be https requests, I started with the following:
server {
listen 80;
location / {
rewrite ^(.*) https://mysite.com$1 ...
88
votes
12answers
89k views
How to set up Nginx as a caching reverse proxy?
I heard recently that Nginx has added caching to its reverse proxy feature. I looked around but couldn't find much info about it.
I want to set up Nginx as a caching reverse proxy in front of ...
55
votes
5answers
14k views
nginx HTTPS serving with same config as HTTP
Is there a way to share configuration directives across two nginx server {} blocks? I'd like to avoid duplicating the rules, as my site's HTTPS and HTTP content are served with the exact same config.
...
54
votes
2answers
15k views
How can I see which flags Nginx was compiled with?
How can I check what modules have been added to an nginx installation?
37
votes
6answers
27k views
How to force or redirect to SSL in nginx?
I have a signup page on a subdomain like: https://signup.mysite.com
It should only be accessible via HTTPS but I'm worried people might somehow stumble upon it via HTTP and get a 404.
My ...
26
votes
1answer
5k views
Why do I need Nginx and something like Gunicorn?
Im looking for a overly simplified answer for the following question. Im trying to build a foundational understanding of how Nginx works along side something like GUnicorn.
Do I need both Nginx and ...
25
votes
4answers
11k views
How to make modification take affect without restart nginx?
Apache has a graceful option which can scan for modification in http.conf without restarting apache,what about nginx?
24
votes
1answer
15k views
How do I add Access-Control-Allow-Origin in NGINX?
I like NGINX but how do I set the Access-Control-Allow-Origin header so I can use web-fonts from my subdomain on my main domain?
23
votes
4answers
22k views
Setting expires headers for static content served from nginx
I'm using nginx to server my static content, is there a way that I can set the expires headers for every file that meets a specific rule? For example can I set the expires header for all files that ...
23
votes
2answers
9k views
Disable caching when serving static files with Nginx (for development)
We are using Nginx to serve static files on a development platform. As it is a development platform, we'd like to disable caching so that each change is propagated to the server. The configuration of ...
22
votes
7answers
9k views
Why is Nginx so fast?
How does a site like rambler serve dynamic content so fast? Even faster than Yahoo (which has a server in my country- SE Asia; rambler does not).
Is this purely Nginx’s capability? Where should I ...
22
votes
5answers
24k views
Configure nginx for jboss/tomcat
In order to pass traffic to JBoss/TomCat on port 80 using Apache we used to install and configure mod_jk.
Is there an equivalent for nginx? Basically want all port 80 traffic to be passed to jboss.
20
votes
3answers
6k views
Apache vs Nginx
I have been investigating the differences between Apache and Nginx recently and am confused about which I should choose.
I have done some searching but there is no definitive comparison between the ...
17
votes
4answers
16k views
Which is best for Django? Lighttpd or Nginx? Or maybe something else?
Which of Lighttpd and Nginx is, basing on your experience, better suited for Django? I've used both and can hardly notice any difference at all, they just work fine... Are there any use cases when one ...
17
votes
2answers
7k views
Is Varnish with nginx better than just using nginx? [closed]
I see a lot of talk about using nginx with Varnish and I do not understand why. Isn't nginx enough?
Nginx has SSI, has reverse proxy cache, is lightweight, has SSL, can work with cgi, fpm, etc.
...